From 6a8d4c1572620b70dc85d559c6532df757196879 Mon Sep 17 00:00:00 2001 From: abn Date: Mon, 15 Sep 2014 14:25:50 +0200 Subject: [PATCH] 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) --- src/Session/SALOME_Session_Server.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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(); -- 2.39.2