X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03e11df5470fd64d9d9a669d0b50b84c2d714736..fe2e43661ec454a020e57deda94db36ca26f8a1e:/src/mac/carbon/app.cpp diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index e238e4f740..97c3590a5e 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -21,6 +21,7 @@ #include "wx/pen.h" #include "wx/brush.h" #include "wx/cursor.h" +#include "wx/intl.h" #include "wx/icon.h" #include "wx/palette.h" #include "wx/dc.h" @@ -356,6 +357,7 @@ bool wxApp::Initialize() #endif +#ifndef __UNIX__ // test the minimal configuration necessary long theSystem ; @@ -392,6 +394,7 @@ bool wxApp::Initialize() } } */ +#endif // if we encountered any problems so far, give the error code and exit immediately @@ -852,12 +855,22 @@ void wxCYield() } // Yield to other processes + +static bool gs_inYield = FALSE; + bool wxYield() { +#ifdef __WXDEBUG__ + if (gs_inYield) + wxFAIL_MSG( wxT("wxYield called recursively" ) ); +#endif + + gs_inYield = TRUE; + #if wxUSE_THREADS - YieldToAnyThread() ; + YieldToAnyThread() ; #endif - EventRecord event ; + EventRecord event ; long sleepTime = 0 ; //::GetCaretTime(); @@ -867,7 +880,19 @@ bool wxYield() } wxMacProcessNotifierAndPendingEvents() ; - return TRUE; + + gs_inYield = FALSE; + + return TRUE; +} + +// Yield to incoming messages; but fail silently if recursion is detected. +bool wxYieldIfNeeded() +{ + if (gs_inYield) + return FALSE; + + return wxYield(); } // platform specifics