From 2f3a79c0af1f8c18254a8d8e07e052e65a6aea31 Mon Sep 17 00:00:00 2001 From: meancoot Date: Sun, 22 Dec 2013 21:34:47 -0500 Subject: [PATCH] (Apple - No Thread) Fix crash when backgrounding the app. --- apple/common/main.m | 2 +- apple/iOS/platform.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apple/common/main.m b/apple/common/main.m index 6cc8be6d01..a329e835dc 100644 --- a/apple/common/main.m +++ b/apple/common/main.m @@ -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()) { diff --git a/apple/iOS/platform.m b/apple/iOS/platform.m index 4c2d1c53f2..ce0d84f6e2 100644 --- a/apple/iOS/platform.m +++ b/apple/iOS/platform.m @@ -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];