Ensure that wxApp::Yield is always processing pending event by creating a
temporary event loop if needed. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -793,14 +793,7 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
||||
|
||||
// Make sure we have an event loop object,
|
||||
// or Pending/Dispatch will fail
|
||||
wxEventLoopBase * const eventLoop = wxEventLoop::GetActive();
|
||||
wxEventLoop* newEventLoop = NULL;
|
||||
if (!eventLoop)
|
||||
{
|
||||
newEventLoop = new wxEventLoop;
|
||||
wxEventLoop::SetActive(newEventLoop);
|
||||
}
|
||||
|
||||
wxEventLoopGuarantor dummyLoopIfNeeded;
|
||||
// Call dispatch at least once so that sockets
|
||||
// can be tested
|
||||
wxTheApp->Dispatch();
|
||||
@@ -813,12 +806,6 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
||||
#endif
|
||||
ProcessIdle();
|
||||
|
||||
if (newEventLoop)
|
||||
{
|
||||
wxEventLoop::SetActive(NULL);
|
||||
delete newEventLoop;
|
||||
}
|
||||
|
||||
s_inYield = false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user