From 5609564c7ab13686fd2bfa8d913f78a3c3c245ac Mon Sep 17 00:00:00 2001 From: barate Date: Tue, 18 Dec 2012 15:51:10 +0000 Subject: [PATCH] Throw exception instead of exit when ContainerManager cannot be resolved in naming service (happens when the naming service is not SALOME Naming service). This fixes bugs when calling salome_init() outside SALOME application. --- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index afd7e6f63..6d138af19 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -100,11 +100,13 @@ SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns) CORBA::Object_var obj = _NS->Resolve(SALOME_ContainerManager::_ContainerManagerNameInNS); - ASSERT( !CORBA::is_nil(obj)); + 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); - ASSERT( !CORBA::is_nil(obj)); + if (CORBA::is_nil(obj)) + throw SALOME_Exception("Error: Cannot resolve ResourceManager in Naming Service"); _ResManager=Engines::ResourcesManager::_narrow(obj); } -- 2.39.2