]> git.saurik.com Git - wxWidgets.git/commitdiff
1) Added call to wxLog::Flush() to wxApp::OnIdle()
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 27 May 1998 23:29:56 +0000 (23:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 27 May 1998 23:29:56 +0000 (23:29 +0000)
2) Last active log target is now deleted in wxApp::CleanUp()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/app.cpp

index 31c1cd18492ff482f0c1327f2e543738ce16ae03..8ba30c66f72dbaeede4665045399497621f1356f 100644 (file)
@@ -331,6 +331,8 @@ void wxApp::CleanUp(void)
   if (wxWinHandleList)
     delete wxWinHandleList ;
     
   if (wxWinHandleList)
     delete wxWinHandleList ;
     
+  // do it as the very last thing because everything else can log messages
+  delete wxLog::SetActiveTarget(NULL);
 }
 
 void wxApp::CommonInit(void)
 }
 
 void wxApp::CommonInit(void)
@@ -816,6 +818,11 @@ void wxApp::OnIdle(wxIdleEvent& event)
   // 'Garbage' collection of windows deleted with Close().
   DeletePendingObjects();
 
   // 'Garbage' collection of windows deleted with Close().
   DeletePendingObjects();
 
+  // flush the logged messages if any
+  wxLog *pLog = wxLog::GetActiveTarget();
+  if ( pLog != NULL && pLog->HasPendingMessages() )
+    pLog->Flush();
+
   // Send OnIdle events to all windows
   bool needMore = SendIdleEvents();
 
   // Send OnIdle events to all windows
   bool needMore = SendIdleEvents();