From: abn Date: Mon, 15 Sep 2014 12:25:50 +0000 (+0200) Subject: Adding explicit ORB destruction at the end of SALOME_Session_Server. X-Git-Tag: V7_5_0a1~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6a8d4c1572620b70dc85d559c6532df757196879;p=modules%2Fgui.git Adding explicit ORB destruction at the end of SALOME_Session_Server. This avoids the nasty Warning from line 43 in Utils_ORB_INIT.cxx (destructor) --- diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 695015339..46030c538 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -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_::Instance(); + if (init) + init->explicit_destroy(); + + // After ORB destruction + PyGILState_Ensure(); + if(Py_IsInitialized()) + Py_Finalize(); if ( shutdownAll ) killOmniNames();