Salome HOME
IPAL0051790: TC7.2.0: SIGSEGV fatal error after close study
[modules/gui.git] / src / SUIT / SUIT_ExceptionHandler.cxx
index 9a616557fae7db416aaa076d7a9fe61f84b35d22..b1fa95b1b9abbb69836044dc30171ad06e6c814c 100755 (executable)
@@ -65,6 +65,28 @@ void SUIT_ExceptionHandler::showMessage( const QString& title, const QString& ms
   
   while ( QApplication::overrideCursor() )
     QApplication::restoreOverrideCursor();
-  
+
+  cleanUp();
+
   SUIT_MessageBox::critical( 0, title, msg );
 }
+
+CleanUpFuncList SUIT_ExceptionHandler::myCleanUpFunctions;
+
+void SUIT_ExceptionHandler::addCleanUpRoutine(CleanUpFunction p)
+{
+  myCleanUpFunctions.append(p);
+}
+
+void SUIT_ExceptionHandler::removeCleanUpRoutine(CleanUpFunction p)
+{
+  myCleanUpFunctions.removeAll(p);
+}
+
+void SUIT_ExceptionHandler::cleanUp()
+{
+  foreach( QtCleanUpFunction f, myCleanUpFunctions )
+  {
+    f();
+  }
+}