use a common m_isInsideYield flag instead of static booleans in all ports; add a IsYielding() test which can help to fix unwanted re-entrancies

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2008-12-29 15:03:39 +00:00
parent 67badd5753
commit d181e877b0
14 changed files with 66 additions and 79 deletions

View File

@@ -777,9 +777,7 @@ bool wxApp::Yield(bool onlyIfNeeded)
int i;
for (i = 0; i < 2; i++)
{
static bool s_inYield = false;
if ( s_inYield )
if ( m_isInsideYield )
{
if ( !onlyIfNeeded )
{
@@ -789,11 +787,12 @@ bool wxApp::Yield(bool onlyIfNeeded)
return false;
}
s_inYield = true;
m_isInsideYield = true;
// Make sure we have an event loop object,
// or Pending/Dispatch will fail
wxEventLoopGuarantor dummyLoopIfNeeded;
wxEventLoopGuarantor dummyLoopIfNeeded;
// Call dispatch at least once so that sockets
// can be tested
wxTheApp->Dispatch();
@@ -806,7 +805,7 @@ bool wxApp::Yield(bool onlyIfNeeded)
#endif
ProcessIdle();
s_inYield = false;
m_isInsideYield = false;
}
return true;