X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FPVGUI%2FPVGUI_Module.cxx;h=9c2853919157d86568350d105f189af1493db55a;hb=1f06dfe3d17b83750bef2a7b5d45760ab57bf68b;hp=f4d072bc8f568e145d4cf634fa1bb6d1f74b70e0;hpb=567d1f0ea0003a9b7978447cc619bf1ce8e9f79a;p=modules%2Fparavis.git diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index f4d072bc..9c285391 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -52,6 +52,7 @@ #include #include #include +#include // SALOME Includes #include "SALOME_LifeCycleCORBA.hxx" @@ -101,6 +102,8 @@ #include #include #include +#include +#include #include #include #include @@ -306,6 +309,18 @@ void vtkEDFHelperInit() { return aSComponent; } +/*! + Clean up function; used to stop ParaView progress events when + exception is caught by global exception handler. +*/ +void paravisCleanUp() +{ + if ( pqApplicationCore::instance() ) { + pqServer* s = pqApplicationCore::instance()->getActiveServer(); + if ( s ) s->session()->GetProgressHandler()->CleanupPendingProgress(); + } +} + /*! \brief Constructor. Sets the default name for the module. */ @@ -786,6 +801,8 @@ static void ParavisMessageOutput(QtMsgType type, const char *msg) bool PVGUI_Module::activateModule( SUIT_Study* study ) { myOldMsgHandler = qInstallMsgHandler(ParavisMessageOutput); + + SUIT_ExceptionHandler::addCleanUpRoutine( paravisCleanUp ); bool isDone = SalomeApp_Module::activateModule( study ); if ( !isDone ) return false; @@ -858,6 +875,8 @@ bool PVGUI_Module::deactivateModule( SUIT_Study* study ) saveDockWidgetsState(); + SUIT_ExceptionHandler::removeCleanUpRoutine( paravisCleanUp ); + if (myOldMsgHandler) qInstallMsgHandler(myOldMsgHandler);