Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Cocoa_ShowMessageBox() should call Cocoa_RegisterApp().
Browse files Browse the repository at this point in the history
Otherwise, message boxes can fail if SDL_Init(SDL_INIT_VIDEO) wasn't completed.
  • Loading branch information
icculus committed Nov 2, 2012
1 parent 61c1035 commit fd7e6d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/video/cocoa/SDL_cocoaevents.m
Expand Up @@ -156,6 +156,7 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam
void
Cocoa_RegisterApp(void)
{
/* This can get called more than once! Be careful what you initialize! */
ProcessSerialNumber psn;
NSAutoreleasePool *pool;

Expand Down
2 changes: 2 additions & 0 deletions src/video/cocoa/SDL_cocoamessagebox.m
Expand Up @@ -37,6 +37,8 @@
int
Cocoa_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
{
Cocoa_RegisterApp();

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

NSAlert* alert = [[NSAlert alloc] init];
Expand Down

0 comments on commit fd7e6d4

Please sign in to comment.