]> git.saurik.com Git - wxWidgets.git/commitdiff
don't call LogLastRepeatIfNeeded() from dtor, it's too late to do it there anyhow...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 2 Jan 2008 21:27:31 +0000 (21:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 2 Jan 2008 21:27:31 +0000 (21:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50994 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/log.cpp

index 250b7b3924495804bc89de222025249efa338ac3..262477de4003838aa9cd3995f574f28f6dd39816 100644 (file)
@@ -490,7 +490,17 @@ unsigned wxLog::LogLastRepeatIfNeededUnlocked()
 
 wxLog::~wxLog()
 {
-    LogLastRepeatIfNeeded();
+    // Flush() must be called before destroying the object as otherwise some
+    // messages could be lost
+    if ( ms_prevCounter )
+    {
+        wxMessageOutputDebug().Printf
+        (
+            wxS("Last repeated message (\"%s\", %lu times) wasn't output"),
+            ms_prevString,
+            ms_prevCounter
+        );
+    }
 }
 
 /* static */
@@ -705,7 +715,7 @@ void wxLog::DoLogString(const wxString& szString, time_t t)
 
 void wxLog::Flush()
 {
-    // nothing to do here
+    LogLastRepeatIfNeeded();
 }
 
 /*static*/ bool wxLog::IsAllowedTraceMask(const wxString& mask)