(Apple - No Thread) Fix crash when backgrounding the app.

This commit is contained in:
meancoot 2013-12-22 21:34:47 -05:00
parent f3d5a44e76
commit 2f3a79c0af
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ static CFRunLoopObserverRef iterate_observer;
static void do_iteration()
{
if (iterate_observer)
if (iterate_observer && apple_is_running && !g_extern.is_paused)
{
if (apple_rarch_iterate_once())
{

View File

@ -231,10 +231,12 @@ static void handle_touch_event(NSArray* touches)
- (void)applicationDidBecomeActive:(UIApplication *)application
{
apple_start_iteration();
}
- (void)applicationWillResignActive:(UIApplication *)application
{
apple_stop_iteration();
}
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
@ -268,12 +270,10 @@ static void handle_touch_event(NSArray* touches)
[[UIApplication sharedApplication] setIdleTimerDisabled:true];
[_window setRootViewController:[RAGameView get]];
g_extern.is_paused = false;
apple_start_iteration();
}
- (IBAction)showPauseMenu:(id)sender
{
apple_stop_iteration();
g_extern.is_paused = true;
[[UIApplication sharedApplication] setStatusBarHidden:false withAnimation:UIStatusBarAnimationNone];
[[UIApplication sharedApplication] setIdleTimerDisabled:false];