Salome HOME
Fix for the '23377: EDF 13481 PARAVIS: SIGSEGV exiting SALOME/PARAVIS' issue.
[modules/gui.git] / src / SUIT / SUIT_Application.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 95a42da..75d32cf
@@ -58,7 +58,8 @@ SUIT_Application::SUIT_Application()
 : QObject( 0 ),
   myStudy( 0 ),
   myDesktop( 0 ),
-  myStatusLabel( 0 )
+  myStatusLabel( 0 ),
+  myPostRoutines( QList<PostRoutine>() )
 {
   if ( SUIT_Session::session() )
     SUIT_Session::session()->insertApplication( this );
@@ -74,6 +75,9 @@ SUIT_Application::~SUIT_Application()
   delete s;
 
   setDesktop( 0 );
+
+  foreach ( PostRoutine routine, myPostRoutines )
+    routine();
 }
 
 /*!
@@ -727,3 +731,9 @@ void SUIT_Application::onHelpContextModule( const QString& /*theComponentName*/,
                                             const QString& /*theContext*/ )
 {
 }
+
+void SUIT_Application::addPostRoutine( PostRoutine theRoutine )
+{
+  if ( !myPostRoutines.contains( theRoutine ) )
+    myPostRoutines << theRoutine;
+}