Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv3737/src/gui

Modified Files:
        wxMApp.cpp 
Log Message:
do (some) cleanup even if the app failed to start up

Index: wxMApp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMApp.cpp,v
retrieving revision 1.233
retrieving revision 1.234
diff -b -u -2 -r1.233 -r1.234
--- wxMApp.cpp  22 Apr 2002 10:12:06 -0000      1.233
+++ wxMApp.cpp  22 Apr 2002 16:49:31 -0000      1.234
@@ -485,4 +485,11 @@
    delete m_logChain;
 #endif // wxHAS_LOG_CHAIN
+
+   DoCleanup();
+
+   Profile::DeleteGlobalConfig();
+
+   MObjectRC::CheckLeaks();
+   MObject::CheckLeaks();
 }
 
@@ -992,15 +999,19 @@
 }
 
-int wxMApp::OnExit()
+void wxMApp::DoCleanup()
 {
-   // we won't be able to do anything more (i.e. another program copy can't ask
-   // us to execute any actions for it) so it's as if we were already not
-   // running at all
+   // we don't really run any more
+   if ( m_snglInstChecker )
+   {
    delete m_snglInstChecker;
    m_snglInstChecker = NULL;
+   }
 
    // no more IPC for us neither
+   if ( m_serverIPC )
+   {
    delete m_serverIPC;
    m_serverIPC = NULL;
+   }
 
    // if one timer was created, then all of them were
@@ -1016,4 +1027,12 @@
       gs_timerAway = NULL;
    }
+}
+
+int wxMApp::OnExit()
+{
+   // we won't be able to do anything more (i.e. another program copy can't ask
+   // us to execute any actions for it) so it's as if we were already not
+   // running at all -- call DoCleanup() to stop IPC service
+   DoCleanup();
 
    CleanUpPrintData();
@@ -1045,10 +1064,6 @@
 #endif // USE_DIALUP
 
-   // FIXME this is not the best place to do it, but at least we're safe
-   //       because we know that by now it's unused any more
-   Profile::DeleteGlobalConfig();
-
-   MObjectRC::CheckLeaks();
-   MObject::CheckLeaks();
+   // save all data now as we may still report errors - later will be too late
+   Profile::FlushAll();
 
    return 0;


_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to