From 1b29603d20339edaf9b1d50107dc348cec72bddf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 29 Apr 2012 23:48:20 +0000 Subject: [PATCH] Work around the problem with not exiting event loop under MSW. Changes of r71304 broke the event loop termination under MSW, limit them to only the case in which they were really needed, i.e. when loop is really exited by a pending event handler. This is only a temporary solution, we need something better in longer term. See #14250. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/evtloopcmn.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/evtloopcmn.cpp b/src/common/evtloopcmn.cpp index de9fce7230..f6f7c4aa1f 100644 --- a/src/common/evtloopcmn.cpp +++ b/src/common/evtloopcmn.cpp @@ -105,12 +105,14 @@ bool wxEventLoopManual::ProcessEvents() // executed) if ( wxTheApp ) { + const bool hadExitedBefore = m_shouldExit; + wxTheApp->ProcessPendingEvents(); // One of the pending event handlers could have decided to exit the // loop so check for the flag before trying to dispatch more events // (which could block indefinitely if no more are coming). - if ( m_shouldExit ) + if ( !hadExitedBefore && m_shouldExit ) { // We still need to dispatch any remaining pending events, just as // we do in the event loop in Run() if the loop is exited from a -- 2.45.2