From 5ea738ffd149c1ca51362a8b4a8b01dfc8bd9f30 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Sun, 11 Apr 2004 04:09:20 +0000 Subject: [PATCH] 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 --- src/cocoa/app.mm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cocoa/app.mm b/src/cocoa/app.mm index ee8284346b..f44ff56c2d 100644 --- a/src/cocoa/app.mm +++ b/src/cocoa/app.mm @@ -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]; }