X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf83f7c6170d8caeda7a3f61ddbd6a822f086002..0157e579ec97555ea4cf07f2a9683fcb3a6b5065:/src/cocoa/app.mm diff --git a/src/cocoa/app.mm b/src/cocoa/app.mm index ee8284346b..2e01d10558 100644 --- a/src/cocoa/app.mm +++ b/src/cocoa/app.mm @@ -6,7 +6,7 @@ // Created: 2002/11/27 // RCS-ID: $Id$ // Copyright: (c) David Elliott -// Licence: wxWindows licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -119,7 +119,7 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication); @implementation wxNSApplicationDelegate : NSObject // NOTE: Terminate means that the event loop does NOT return and thus -// cleanup code doesn't properly execute. Furthermore, wxWindows has its +// cleanup code doesn't properly execute. Furthermore, wxWidgets has its // own exit on frame delete mechanism. - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication { @@ -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() + while(1) + { + wxAutoNSAutoreleasePool pool; + NSEvent *event = [GetNSApplication() nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate distantPast] + untilDate:nil /* ==[NSDate distantPast] */ inMode:NSDefaultRunLoopMode - dequeue: YES]) - { + dequeue: YES]; + if(!event) + break; [GetNSApplication() sendEvent: event]; }