]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
TODO : improve it for GUI mode. OK for GEOM standalone agy/archi5_00
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 23 Feb 2021 07:52:47 +0000 (08:52 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 23 Feb 2021 07:52:47 +0000 (08:52 +0100)
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx

index 6a2088bfa0993e0da5f0cd7f7082bbddfd94c4a9..1d121a0af14a4c8931cd1069115f77998fa39689 100644 (file)
@@ -104,17 +104,19 @@ SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService_Abstract *ns)
   // not enough: set a current directory in naming service is not thread safe
   // if naming service instance is shared among several threads...
   // ==> always use absolute path and don't rely on current directory!
-
-  CORBA::Object_var obj =
-    _NS->Resolve(SALOME_ContainerManager::_ContainerManagerNameInNS);
-  if (CORBA::is_nil(obj))
-    throw SALOME_Exception("Error: Cannot resolve ContainerManager in Naming Service");
-  _ContManager=Engines::ContainerManager::_narrow(obj);
-
-  obj = _NS->Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS);
-  if (CORBA::is_nil(obj))
-    throw SALOME_Exception("Error: Cannot resolve ResourceManager in Naming Service");
-  _ResManager=Engines::ResourcesManager::_narrow(obj);
+  if( dynamic_cast<SALOME_NamingService *>(_NS) )
+  {
+    CORBA::Object_var obj =
+      _NS->Resolve(SALOME_ContainerManager::_ContainerManagerNameInNS);
+    if (CORBA::is_nil(obj))
+      throw SALOME_Exception("Error: Cannot resolve ContainerManager in Naming Service");
+    _ContManager=Engines::ContainerManager::_narrow(obj);
+
+    obj = _NS->Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS);
+    if (CORBA::is_nil(obj))
+      throw SALOME_Exception("Error: Cannot resolve ResourceManager in Naming Service");
+    _ResManager=Engines::ResourcesManager::_narrow(obj);
+  }
 }
 
 //=============================================================================