src/video/cocoa/SDL_cocoakeyboard.m
changeset 3683 4c5ab6841fdc
parent 3676 1ab77e93a6c9
child 4434 5c64052fb476
     1.1 --- a/src/video/cocoa/SDL_cocoakeyboard.m	Tue Jan 19 05:31:16 2010 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoakeyboard.m	Tue Jan 19 07:28:51 2010 +0000
     1.3 @@ -99,7 +99,9 @@
     1.4  
     1.5  - (void) doCommandBySelector:(SEL) myselector
     1.6  {
     1.7 -    [super doCommandBySelector: myselector];
     1.8 +    // No need to do anything since we are not using Cocoa
     1.9 +    // selectors to handle special keys, instead we use SDL
    1.10 +    // key events to do the same job.
    1.11  }
    1.12  
    1.13  - (BOOL) hasMarkedText
    1.14 @@ -649,11 +651,13 @@
    1.15  {
    1.16      SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    1.17  
    1.18 -    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.19 -    [data->fieldEdit removeFromSuperview];
    1.20 -    [data->fieldEdit release];
    1.21 -    data->fieldEdit = nil;
    1.22 -    [pool release];
    1.23 +    if (data && data->fieldEdit) {
    1.24 +        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.25 +        [data->fieldEdit removeFromSuperview];
    1.26 +        [data->fieldEdit release];
    1.27 +        data->fieldEdit = nil;
    1.28 +        [pool release];
    1.29 +    }
    1.30  }
    1.31  
    1.32  void