From 26e8d7648cefe295fba54364c1daf3565773b97b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 6 Jul 2013 00:32:20 -0700 Subject: [PATCH] Fixed potential problem with postFinishLaunch being overridden by the application. Vittorio Giovara I find that the calling point in SDL_uikitappdelegate.m is dangerous as the -(void) postFinishLaunch method can be overridden when subclassing. Could this be moved in inside the init or in the didFinishLaunchingWithOptions method which are always called even when subclassed? --- src/video/uikit/SDL_uikitappdelegate.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m index 3b544db2c..d37a09124 100644 --- a/src/video/uikit/SDL_uikitappdelegate.m +++ b/src/video/uikit/SDL_uikitappdelegate.m @@ -186,8 +186,6 @@ - (id)init - (void)postFinishLaunch { - SDL_SetMainReady(); - /* run the user's application, passing argc and argv */ SDL_iPhoneSetEventPump(SDL_TRUE); exit_status = SDL_main(forward_argc, forward_argv); @@ -223,6 +221,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( SDL_SetHint(SDL_HINT_IDLE_TIMER_DISABLED, "0"); SDL_RegisterHintChangedCb(SDL_HINT_IDLE_TIMER_DISABLED, &SDL_IdleTimerDisabledChanged); + SDL_SetMainReady(); [self performSelector:@selector(postFinishLaunch) withObject:nil afterDelay:0.0]; return YES;