From: Anthony Geay Date: Tue, 23 Feb 2021 07:52:47 +0000 (+0100) Subject: TODO : improve it for GUI mode. OK for GEOM standalone X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fagy%2Farchi5_00;p=modules%2Fkernel.git TODO : improve it for GUI mode. OK for GEOM standalone --- diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 6a2088bfa..1d121a0af 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -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(_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); + } } //=============================================================================