From: caremoli Date: Thu, 27 Jan 2011 10:57:06 +0000 (+0000) Subject: CCAR: catch all exceptions in qt handler X-Git-Tag: V6_3_0a1~76 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4d4138b1f0a6b32e147d79f2a5beaa89906b9bc4;p=modules%2Fgui.git CCAR: catch all exceptions in qt handler and abort session server if exception has been caught in orb shutdown --- diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 507c39992..851557ce0 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -290,8 +290,18 @@ public: return myHandler ? myHandler->handle( receiver, e ) : TestApplication::notify( receiver, e ); #else - return myHandler ? myHandler->handle( receiver, e ) : - QApplication::notify( receiver, e ); + try + { + return myHandler ? myHandler->handle( receiver, e ) : QApplication::notify( receiver, e ); + } + catch(std::exception& e) + { + std::cerr << e.what() << std::endl; + } + catch(...) + { + std::cerr << "Unknown exception caught in Qt handler: it's probably a bug in SALOME platform" << std::endl; + } #endif } SUIT_ExceptionHandler* handler() const { return myHandler; } @@ -604,7 +614,10 @@ int main( int argc, char **argv ) // exception is raised when orb->destroy() is called and // cpp continer is launched in the embedded mode ////////////////////////////////////////////////////////////// - // std::cerr << "Caught unexpected exception on destroy : ignored !!" << std::endl; + // std::cerr << "Caught unexpected exception on shutdown : ignored !!" << std::endl; + if ( shutdown ) + killOmniNames(); + abort(); //abort program to avoid deadlock in destructors or atexit when shutdown has been interrupted } PyGILState_Ensure();