• Sam Lantinga's avatar
    Fixed bug #847 · 8f71172a
    Sam Lantinga authored
     Roger Willcocks      2009-10-25 08:45:37 PDT
    
    appDidFinishLaunching is triggered before all the setup's complete. The easiest
    fix is to arrange for another event to be sent when it's really ready, and run
    SDL_main from there. Ref.
    http://blog.rightsprite.com/2008/11/iphone-applicationdidfinishlaunching.html
    
    SDL-1.3.0-4563/src/video/uikit/SDL_uikitappdelegate.m:
    
    
    
    - (void)postFinishLaunch {
    
        /* 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, passing the return status from the user's application */
        exit(exit_status);
    
    }
    
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    
        /* Set working directory to resource path */
        [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle
    mainBundle] resourcePath]];
    
        [self performSelector:@selector(postFinishLaunch) withObject:nil
    afterDelay:0.0];
    
    --HG--
    extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404148
    8f71172a
Name
Last commit
Last update
..
SDL_uikitappdelegate.h Loading commit data...
SDL_uikitappdelegate.m Loading commit data...
SDL_uikitevents.h Loading commit data...
SDL_uikitevents.m Loading commit data...
SDL_uikitkeyboard.h Loading commit data...
SDL_uikitopengles.h Loading commit data...
SDL_uikitopengles.m Loading commit data...
SDL_uikitopenglview.h Loading commit data...
SDL_uikitopenglview.m Loading commit data...
SDL_uikitvideo.h Loading commit data...
SDL_uikitvideo.m Loading commit data...
SDL_uikitview.h Loading commit data...
SDL_uikitview.m Loading commit data...
SDL_uikitwindow.h Loading commit data...
SDL_uikitwindow.m Loading commit data...
jumphack.c Loading commit data...
jumphack.h Loading commit data...
keyinfotable.h Loading commit data...