From 8e926518242ab3b93ba5bf3372ab7afa66c24071 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 13 Nov 2012 08:36:01 +0000 Subject: [PATCH] 0021688: [CEA 572] Issue when using runSalome -k -t --- src/Container/SALOME_ContainerManager.cxx | 16 +++++++++++++++- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index a513af413..3a6cebdf7 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -36,6 +36,9 @@ #include #include +#include +#include CORBA_CLIENT_HEADER(SALOME_Session) + #ifdef WNT #include #define getpid _getpid @@ -187,6 +190,17 @@ void SALOME_ContainerManager::Shutdown() void SALOME_ContainerManager::ShutdownContainers() { MESSAGE("ShutdownContainers"); + + SALOME::Session_var session = SALOME::Session::_nil(); + CORBA::Long pid = 0; + CORBA::Object_var objS = _NS->Resolve("/Kernel/Session"); + if (!CORBA::is_nil(objS)) + { + session = SALOME::Session::_narrow(objS); + if (!CORBA::is_nil(session)) + pid = session->getPID(); + } + bool isOK; isOK = _NS->Change_Directory("/Containers"); if( isOK ){ @@ -199,7 +213,7 @@ void SALOME_ContainerManager::ShutdownContainers() try { Engines::Container_var cont=Engines::Container::_narrow(obj); - if(!CORBA::is_nil(cont)) + if(!CORBA::is_nil(cont) && pid != cont->getPID()) lstCont.push_back((*iter)); } catch(const CORBA::Exception& e) diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 2afca3b7f..afd7e6f63 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -550,6 +550,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() if (!CORBA::is_nil(session)) { pid = session->getPID(); + session->Shutdown(); } } @@ -644,6 +645,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() // ignore and continue } + /* // 6) Session if ( !CORBA::is_nil( session ) ) { try @@ -655,6 +657,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() // ignore and continue } } + */ // 7) Logger int argc = 0; -- 2.39.2