From 07f279ec6474d152ad0c346e0d88ede4c36e28c5 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Tue, 23 Feb 2021 08:52:47 +0100 Subject: [PATCH] TODO : improve it for GUI mode. OK for GEOM standalone --- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) 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); + } } //============================================================================= -- 2.39.2