Cocoa_ShowMessageBox() should call Cocoa_RegisterApp().

Otherwise, message boxes can fail if SDL_Init(SDL_INIT_VIDEO) wasn't completed.
This commit is contained in:
Ryan C. Gordon
2012-11-02 16:48:47 -04:00
parent 23ecca6648
commit 0a9a0e077a
2 changed files with 3 additions and 0 deletions

View File

@@ -156,6 +156,7 @@ CreateApplicationMenus(void)
void
Cocoa_RegisterApp(void)
{
/* This can get called more than once! Be careful what you initialize! */
ProcessSerialNumber psn;
NSAutoreleasePool *pool;

View File

@@ -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];