From: Vadim Zeitlin Date: Wed, 19 Aug 2009 23:51:24 +0000 (+0000) Subject: Flush log events in console applications as well. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0055cc0e4a21e460eab83a79269f3fe5b0037239 Flush log events in console applications as well. Move wxLog::FlushActive() call from wxAppBase::ProcessIdle() to wxAppConsoleBase::ProcessIdle(). Now that log messages from background threads are queued until the main thread log target is flushed, we need to call wxLog::FlushActive() periodically to see them at all, see #11115. Besides, even though the default log target in console applications outputs the messages immediately without queuing them, it is quite possible to use a non-default target which does require flushing so this change also fixes a potential bug with non-default log targets. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index db26530d66..c2d019fd25 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -340,6 +340,12 @@ bool wxAppConsoleBase::ProcessIdle() event.SetEventObject(this); ProcessEvent(event); +#if wxUSE_LOG + // flush the logged messages if any (do this after processing the events + // which could have logged new messages) + wxLog::FlushActive(); +#endif + return event.MoreRequested(); } diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 61930ed1f5..ea3a17c7c9 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -355,11 +355,6 @@ bool wxAppBase::ProcessIdle() node = node->GetNext(); } -#if wxUSE_LOG - // flush the logged messages if any - wxLog::FlushActive(); -#endif - wxUpdateUIEvent::ResetUpdateTime(); return needMore;