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 ) :
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();