src/video/cocoa/SDL_cocoawindow.m
changeset 7946 57c34a54b7c2
parent 7915 86ad156a82ab
child 7948 64e133a8b15e
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sun Nov 10 20:38:50 2013 -0300
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sun Nov 10 17:40:35 2013 -0800
     1.3 @@ -748,7 +748,14 @@
     1.4              rect.origin.y -= screenRect.origin.y;
     1.5          }
     1.6      }
     1.7 -    nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO screen:screen];
     1.8 +
     1.9 +    @try {
    1.10 +        nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO screen:screen];
    1.11 +    }
    1.12 +    @catch (NSException *e) {
    1.13 +        SDL_SetError("%s", [[e reason] UTF8String]);
    1.14 +        return -1;
    1.15 +    }
    1.16      [nswindow setBackgroundColor:[NSColor blackColor]];
    1.17  
    1.18      /* Create a default view for this window */