Salome HOME
0022712: [CEA 1300] LightApp_PreferencesDlg - invalid layout / resize policy
[modules/gui.git] / src / Session / SALOME_Session_Server.cxx
index 695015339a978d28812dfa2b20b02e07fac5e410..4d34b5e5822f4c08160cc49bb2b8ca8d13929900 100755 (executable)
@@ -259,19 +259,6 @@ public:
 
   virtual bool notify( QObject* receiver, QEvent* e )
   {
-#if OCC_VERSION_LARGE < 0x06010100
-    // Disable GUI user actions while python command is executed
-    if (SUIT_Session::IsPythonExecuted()) {
-      // Disable mouse and keyboard events
-      QEvent::Type aType = e->type();
-      if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
-          aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
-          aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
-          aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
-          aType == QEvent::Accel || aType == QEvent::AccelOverride)
-        return false;
-    }
-#endif
 
 #ifdef ENABLE_TESTRECORDER
     return myHandler ? myHandler->handle( receiver, e ) :
@@ -654,12 +641,23 @@ 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
+  if(Py_IsInitialized())
+    {
+      PyGILState_Ensure();
+      Py_Finalize();
+    }
 
   if ( shutdownAll )
     killOmniNames();