]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/init.cpp
Added chapter on collection and container classes to contents
[wxWidgets.git] / src / common / init.cpp
index 78576fb3c545eec7e749a34308f1eb430f41bf6f..390dced3de669ff46f3a40da23f478caf15d049f 100644 (file)
@@ -35,7 +35,7 @@
 // global vars
 // ----------------------------------------------------------------------------
 
-wxApp * WXDLLEXPORT wxTheApp = NULL;
+WXDLLEXPORT wxApp *wxTheApp = NULL;
 
 wxAppInitializerFunction
     wxAppBase::m_appInitFn = (wxAppInitializerFunction)NULL;
@@ -219,9 +219,8 @@ static void DoCleanUp()
     // continuing to use user defined log target is unsafe from now on because
     // some resources may be already unavailable, so replace it by something
     // more safe
-    wxLog *oldlog = wxLog::SetActiveTarget(new wxLogStderr);
-    if ( oldlog )
-        delete oldlog;
+    wxLog::DontCreateOnDemand();
+    delete wxLog::SetActiveTarget(new wxLogStderr);
 #endif // wxUSE_LOG
 
     wxModule::CleanUpModules();
@@ -231,4 +230,9 @@ static void DoCleanUp()
     // delete the application object
     delete wxTheApp;
     wxTheApp = (wxApp *)NULL;
+
+#if wxUSE_LOG
+    // and now delete the last logger as well
+    delete wxLog::SetActiveTarget(NULL);
+#endif // wxUSE_LOG
 }