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
This commit is contained in:
parent
afaf3b7037
commit
0055cc0e4a
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user