]> git.saurik.com Git - wxWidgets.git/commitdiff
Yielding from a non-gui thread needs to bail out, otherwise we end up
authorRobin Dunn <robin@alldunn.com>
Thu, 7 Jun 2007 18:34:54 +0000 (18:34 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 7 Jun 2007 18:34:54 +0000 (18:34 +0000)
possibly sending events in the thread too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46357 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/app.cpp

index 683d9c7401786ff1271228917bb942245fc58857..a48440d002189e6f3782ff805efdae77290f3a8a 100644 (file)
@@ -1196,6 +1196,15 @@ bool wxApp::Yield(bool onlyIfNeeded)
         return false;
     }
 
+#if wxUSE_THREADS
+    // Yielding from a non-gui thread needs to bail out, otherwise we end up
+    // possibly sending events in the thread too.
+    if ( !wxThread::IsMain() )
+    {
+        return true;
+    }
+#endif // wxUSE_THREADS
+
     s_inYield = true;
 
     // by definition yield should handle all non-processed events