Commit b0e7f4b0 authored by Kees Bakker's avatar Kees Bakker

Do not exit in (uikit) postFinishLaunch but store the exit status and use that...

Do not exit in (uikit) postFinishLaunch but store the exit status and use that to return from main()

Also cleanup the stored argv in main() instead of postFinishLaunch.
parent 9da0e1c8
......@@ -36,6 +36,7 @@
extern int SDL_main(int argc, char *argv[]);
static int forward_argc;
static char **forward_argv;
static int exit_status;
int main(int argc, char **argv)
{
......@@ -54,8 +55,14 @@ int main(int argc, char **argv)
/* Give over control to run loop, SDLUIKitDelegate will handle most things from here */
UIApplicationMain(argc, argv, NULL, [SDLUIKitDelegate getAppDelegateClassName]);
/* free the memory we used to hold copies of argc and argv */
for (i = 0; i < forward_argc; i++) {
free(forward_argv[i]);
}
free(forward_argv);
[pool release];
return 0;
return exit_status;
}
static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue, const char *newValue)
......@@ -95,17 +102,10 @@ static void SDL_IdleTimerDisabledChanged(const char *name, const char *oldValue,
SDL_RegisterHintChangedCb(SDL_HINT_IDLE_TIMER_DISABLED, &SDL_IdleTimerDisabledChanged);
/* run the user's application, passing argc and argv */
int exit_status = SDL_main(forward_argc, forward_argv);
/* free the memory we used to hold copies of argc and argv */
int i;
for (i = 0; i < forward_argc; i++) {
free(forward_argv[i]);
}
free(forward_argv);
exit_status = SDL_main(forward_argc, forward_argv);
/* exit, passing the return status from the user's application */
exit(exit_status);
// exit(exit_status);
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment