Skip to content

Commit

Permalink
Fixed bug 2176 - SDL_CreateWindow(w=INT_MAX, h=INT_MAX) causes progra…
Browse files Browse the repository at this point in the history
…m to hang

Catch exceptions generated when trying to create a Cocoa window.
  • Loading branch information
slouken committed Nov 11, 2013
1 parent 15a3bbc commit 5821466
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -748,7 +748,14 @@ - (void)resetCursorRects
rect.origin.y -= screenRect.origin.y;
}
}
nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO screen:screen];

@try {
nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO screen:screen];
}
@catch (NSException *e) {
SDL_SetError("%s", [[e reason] UTF8String]);
return -1;
}
[nswindow setBackgroundColor:[NSColor blackColor]];

/* Create a default view for this window */
Expand Down

0 comments on commit 5821466

Please sign in to comment.