]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Adding explicit ORB destruction at the end of SALOME_Session_Server.
authorabn <adrien.bruneton@cea.fr>
Mon, 15 Sep 2014 12:25:50 +0000 (14:25 +0200)
committerabn <adrien.bruneton@cea.fr>
Mon, 15 Sep 2014 12:25:50 +0000 (14:25 +0200)
This avoids the nasty Warning from line 43 in Utils_ORB_INIT.cxx (destructor)

src/Session/SALOME_Session_Server.cxx

index 695015339a978d28812dfa2b20b02e07fac5e410..46030c5385088981c006c25ba0a85d39d6916bf6 100755 (executable)
@@ -654,12 +654,21 @@ int main( int argc, char **argv )
     abort(); //abort program to avoid deadlock in destructors or atexit when shutdown has been interrupted
   }
 
-  PyGILState_Ensure();
-  //Destroy orb from python (for chasing memory leaks)
+    //Destroy orb from python (for chasing memory leaks)
   //PyRun_SimpleString("from omniORB import CORBA");
   //PyRun_SimpleString("orb=CORBA.ORB_init([''], CORBA.ORB_ID)");
   //PyRun_SimpleString("orb.destroy()");
-  Py_Finalize();
+
+  // Destroy the ORB:
+  MESSAGE("Explicitely destroying the ORB (hoping to kill omniORB threads ...)");
+  ORB_INIT * init = SINGLETON_<ORB_INIT>::Instance();
+  if (init)
+    init->explicit_destroy();
+
+  // After ORB destruction
+  PyGILState_Ensure();
+  if(Py_IsInitialized())
+    Py_Finalize();
 
   if ( shutdownAll )
     killOmniNames();