src/video/cocoa/SDL_cocoaevents.m
changeset 1932 dc864bcabcc4
parent 1931 103c6fec2a60
child 1936 83946ee0ff1f
equal deleted inserted replaced
1931:103c6fec2a60 1932:dc864bcabcc4
   155 Cocoa_PumpEvents(_THIS)
   155 Cocoa_PumpEvents(_THIS)
   156 {
   156 {
   157     NSAutoreleasePool *pool;
   157     NSAutoreleasePool *pool;
   158 
   158 
   159     pool = [[NSAutoreleasePool alloc] init];
   159     pool = [[NSAutoreleasePool alloc] init];
   160     for ( ; [NSApp isRunning]; ) {
   160     while ([NSApp isRunning]) {
   161         NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
   161         NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES ];
   162         if ( event == nil ) {
   162         if ( event == nil ) {
   163             break;
   163             break;
   164         }
   164         }
   165         [NSApp sendEvent:event];
   165         [NSApp sendEvent:event];