Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv14591/src/gui
Modified Files:
wxMApp.cpp
Log Message:
do cleanup when OnInit() fails too
Index: wxMApp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMApp.cpp,v
retrieving revision 1.277
retrieving revision 1.278
diff -b -u -2 -r1.277 -r1.278
--- wxMApp.cpp 21 Sep 2003 00:19:45 -0000 1.277
+++ wxMApp.cpp 27 Sep 2003 23:15:51 -0000 1.278
@@ -467,6 +467,4 @@
wxMApp::~wxMApp()
{
- DoCleanup();
-
// if the program startup failed it could be not deleted before
if ( m_profile )
@@ -817,5 +815,9 @@
// parse our command line options inside OnInit()
if ( !wxApp::OnInit() )
+ {
+ DoCleanup();
+
return false;
+ }
#endif // wxWin 2.3.2+
@@ -979,4 +981,6 @@
//else: this would be superfluous
+ DoCleanup();
+
return false;
}
@@ -1104,12 +1108,4 @@
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();
@@ -1131,12 +1127,25 @@
MModule_Cleanup();
+
+ if ( m_IconManager )
+ {
delete m_IconManager;
+ m_IconManager = NULL;
+ }
#ifdef USE_I18N
+ if ( m_Locale )
+ {
delete m_Locale;
+ m_Locale = NULL;
+ }
#endif // USE_I18N
#ifdef USE_DIALUP
+ if ( m_OnlineManager )
+ {
delete m_OnlineManager;
+ m_OnlineManager = NULL;
+ }
#endif // USE_DIALUP
@@ -1147,4 +1156,11 @@
Profile::DeleteGlobalConfig();
+}
+
+int wxMApp::OnExit()
+{
+ DoCleanup();
+
+ // this does cleanup which must be done whether OnInit() succeeded or failed
return wxApp::OnExit();
}
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates