From: Bernard Secher Date: Thu, 29 Nov 2018 13:28:33 +0000 (+0100) Subject: destroy containers in naming service at the end of session X-Git-Tag: V9_4_0a1~12^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=32d96958f07dfde87a4d2676231b51507275e6f7;p=modules%2Fgui.git destroy containers in naming service at the end of session --- diff --git a/src/Session/Session_Session_i.cxx b/src/Session/Session_Session_i.cxx index 846392356..05a6e34b4 100644 --- a/src/Session/Session_Session_i.cxx +++ b/src/Session/Session_Session_i.cxx @@ -137,6 +137,7 @@ void SALOME_Session_i::NSunregister() { _NS->Destroy_Name("/Kernel/Session"); _NS->Destroy_Directory("/Kernel"); + deleteContainersinNS(); } catch (ServiceUnreachable&) { @@ -342,3 +343,30 @@ SALOME::StringSeq* SALOME_Session_i::getSelection() _GUIMutex->unlock(); return selection._retn(); } + +void SALOME_Session_i::deleteContainersinNS() +{ +// destroy of all containers and modules + _NS->Change_Directory("/Containers"); + std::vector machines = _NS->list_subdirs(); + for(int i=0;iChange_Directory(machines[i].c_str()); + std::vector toto = _NS->list_directory(); + for(int j=0;jDestroy_Name(toto[j].c_str()); + std::vector containers = _NS->list_subdirs(); + for(int j=0;jChange_Directory(containers[j].c_str()); + std::vector modules = _NS->list_directory(); + for(int k=0;kDestroy_Name(modules[k].c_str()); + _NS->Change_Directory("/Containers"); + _NS->Change_Directory(machines[i].c_str()); + _NS->Destroy_Directory(containers[j].c_str()); + } + _NS->Change_Directory("/Containers"); + _NS->Destroy_Directory(machines[i].c_str()); + } + _NS->Change_Directory("/"); + _NS->Destroy_Directory("/Containers"); +} diff --git a/src/Session/Session_Session_i.hxx b/src/Session/Session_Session_i.hxx index 37111ee76..f2b113446 100644 --- a/src/Session/Session_Session_i.hxx +++ b/src/Session/Session_Session_i.hxx @@ -95,6 +95,8 @@ protected: CORBA::ORB_var _orb; PortableServer::POA_var _poa; bool _isShuttingDown; + + void deleteContainersinNS(); }; #endif