Fixed bug 2176 - SDL_CreateWindow(w=INT_MAX, h=INT_MAX) causes program to hang
Catch exceptions generated when trying to create a Cocoa window. --HG-- extra : rebase_source : e30cf93c954ce9039e5522aa2d5a87f25e9e9386
This commit is contained in:
parent
31dab00ac0
commit
60a701fa5d
1 changed files with 8 additions and 1 deletions
|
@ -748,7 +748,14 @@ Cocoa_CreateWindow(_THIS, SDL_Window * window)
|
|||
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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue