Salome HOME
Merge from V5_1_3_BR 07/12/2009
[modules/kernel.git] / src / LifeCycleCORBA / SALOME_LifeCycleCORBA.cxx
index 197da12db9a570005b092792b73b70eaa515854a..53455360982754f42b8ebcf52db9da14789e35d7 100644 (file)
@@ -85,9 +85,11 @@ SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns)
   char **argv = &xargv;
   CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
   //  LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
+  _NSnew=0;
   if (!ns)
     {
       _NS = new SALOME_NamingService(orb);
+      _NSnew=_NS;
     }
   else _NS = ns;
   //add try catch
@@ -115,6 +117,7 @@ SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns)
 
 SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA()
 {
+  if(_NSnew)delete _NSnew;
 }
 
 //=============================================================================
@@ -274,7 +277,7 @@ SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName,
     {
       // containerName doesn't contain "/" => Local container
       params->container_name=CORBA::string_dup(stContainer);
-      params->hostname=CORBA::string_dup(Kernel_Utils::GetHostname().c_str());
+      params->hostname="";
     }
   else 
     {
@@ -734,3 +737,21 @@ void SALOME_LifeCycleCORBA::copyFile(const char* hostSrc, const char* fileSrc, c
   containerDest->copyFile(containerSrc,fileSrc,fileDest);
 }
 
+/*! \brief get the naming service used by the life cycle
+ *
+ *  \return the naming service
+ */
+SALOME_NamingService * SALOME_LifeCycleCORBA::namingService()
+{
+  return _NS;
+}
+
+/*! \brief get the orb used by the life cycle
+ *
+ *  \return the orb
+ */
+CORBA::ORB_ptr SALOME_LifeCycleCORBA::orb()
+{
+  return _NS->orb();
+}
+