]> git.saurik.com Git - wxWidgets.git/commitdiff
Work around the problem with not exiting event loop under MSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 29 Apr 2012 23:48:20 +0000 (23:48 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 29 Apr 2012 23:48:20 +0000 (23:48 +0000)
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

index de9fce7230d2728d7fcbec491b95bdc6954efb4b..f6f7c4aa1f33e6a6d07b8a90826a169e9b232dfb 100644 (file)
@@ -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