Fixed potential problem with postFinishLaunch being overridden by the application.
authorSam Lantinga <slouken@libsdl.org>
Sat, 06 Jul 2013 00:32:20 -0700
changeset 7355 65592096da2d
parent 7354 ccc59c3bd1ba
child 7356 d1a0bbe64f15
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
--- a/src/video/uikit/SDL_uikitappdelegate.m	Sat Jul 06 00:28:54 2013 -0700
+++ b/src/video/uikit/SDL_uikitappdelegate.m	Sat Jul 06 00:32:20 2013 -0700
@@ -186,8 +186,6 @@
 
 - (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 @@
     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;