pusing a dummy event, to make sure the stop: succeeds in immediate runloop termination, instead of waiting for the next user event

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2011-01-01 16:25:37 +00:00
parent 29188693b3
commit 2e5f9929e6

View File

@@ -179,6 +179,16 @@ void wxGUIEventLoop::DoRun()
void wxGUIEventLoop::DoStop()
{
[NSApp stop:0];
// only calling stop: is not enough when called from a runloop-observer,
// therefore add a dummy event, to make sure the runloop gets another round
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
location:NSMakePoint(0.0, 0.0)
modifierFlags:0
timestamp:0
windowNumber:0
context:nil
subtype:0 data1:0 data2:0];
[NSApp postEvent:event atStart:FALSE];
}
CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const