Yield changes:

1. Rework the loop using wxAutoNSAutoreleasePool such that each iteration
   (get/send event) is done within the context of an NSAutoreleasePool.
2. Use nil instead of [NSDate distantPast] (means the same thing)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2004-04-11 04:09:20 +00:00
parent 1b1f8b2d8b
commit 5ea738ffd1

View File

@@ -306,12 +306,16 @@ bool wxApp::Yield(bool onlyIfNeeded)
s_inYield = true;
// Run the event loop until it is out of events
while(NSEvent *event = [GetNSApplication()
nextEventMatchingMask:NSAnyEventMask
untilDate:[NSDate distantPast]
inMode:NSDefaultRunLoopMode
dequeue: YES])
while(1)
{
wxAutoNSAutoreleasePool pool;
NSEvent *event = [GetNSApplication()
nextEventMatchingMask:NSAnyEventMask
untilDate:nil /* ==[NSDate distantPast] */
inMode:NSDefaultRunLoopMode
dequeue: YES];
if(!event)
break;
[GetNSApplication() sendEvent: event];
}