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

Commit

Permalink
Fixed potential problem with postFinishLaunch being overridden by the…
Browse files Browse the repository at this point in the history
… 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?
  • Loading branch information
slouken committed Jul 6, 2013
1 parent fa2d022 commit 26e8d76
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/video/uikit/SDL_uikitappdelegate.m
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 26e8d76

Please sign in to comment.