]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/evtloopcmn.cpp
Don't change wxTextEntry value if it didn't really change.
[wxWidgets.git] / src / common / evtloopcmn.cpp
index aa1aca9cbc95f51b7c65eb0940dfc070237bd945..de9fce7230d2728d7fcbec491b95bdc6954efb4b 100644 (file)
@@ -82,7 +82,7 @@ bool wxEventLoopBase::Yield(bool onlyIfNeeded)
 }
 
 // wxEventLoopManual is unused in the other ports
-#if defined(__WXMSW__) || defined(__WXDFB__) || ( ( defined(__UNIX__) && !defined(__WXOSX__) ) && wxUSE_BASE)
+#if defined(__WINDOWS__) || defined(__WXDFB__) || ( ( defined(__UNIX__) && !defined(__WXOSX__) ) && wxUSE_BASE)
 
 // ============================================================================
 // wxEventLoopManual implementation
@@ -104,8 +104,24 @@ bool wxEventLoopManual::ProcessEvents()
     // and this input is only removed from it when pending event handlers are
     // executed)
     if ( wxTheApp )
+    {
         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 )
+        {
+            // 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
+            // normal event handler.
+            while ( wxTheApp->HasPendingEvents() )
+                wxTheApp->ProcessPendingEvents();
+
+            return false;
+        }
+    }
+
     return Dispatch();
 }
 
@@ -213,5 +229,5 @@ void wxEventLoopManual::Exit(int rc)
     WakeUp();
 }
 
-#endif // __WXMSW__ || __WXMAC__ || __WXDFB__
+#endif // __WINDOWS__ || __WXMAC__ || __WXDFB__