Fixed potential problem with postFinishLaunch being overridden by the application.
authorSam Lantinga <slouken@libsdl.org>
Sat, 06 Jul 2013 00:32:20 -0700
changeset 735565592096da2d
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
     1.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Sat Jul 06 00:28:54 2013 -0700
     1.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Sat Jul 06 00:32:20 2013 -0700
     1.3 @@ -186,8 +186,6 @@
     1.4  
     1.5  - (void)postFinishLaunch
     1.6  {
     1.7 -    SDL_SetMainReady();
     1.8 -
     1.9      /* run the user's application, passing argc and argv */
    1.10      SDL_iPhoneSetEventPump(SDL_TRUE);
    1.11      exit_status = SDL_main(forward_argc, forward_argv);
    1.12 @@ -223,6 +221,7 @@
    1.13      SDL_SetHint(SDL_HINT_IDLE_TIMER_DISABLED, "0");
    1.14      SDL_RegisterHintChangedCb(SDL_HINT_IDLE_TIMER_DISABLED, &SDL_IdleTimerDisabledChanged);
    1.15  
    1.16 +    SDL_SetMainReady();
    1.17      [self performSelector:@selector(postFinishLaunch) withObject:nil afterDelay:0.0];
    1.18  
    1.19      return YES;