Explorar o código

Fixed possible crash on iOS in applicationDidReceiveMemoryWarning method: event loop may be null when it's called.

Ivan Ponomarev %!s(int64=6) %!d(string=hai) anos
pai
achega
1d576f17a7
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      platform/iphone/app_delegate.mm

+ 4 - 2
platform/iphone/app_delegate.mm

@@ -598,8 +598,10 @@ static int frame_count = 0;
 };
 
 - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
-	OS::get_singleton()->get_main_loop()->notification(
-			MainLoop::NOTIFICATION_OS_MEMORY_WARNING);
+	if (OS::get_singleton()->get_main_loop()) {
+		OS::get_singleton()->get_main_loop()->notification(
+				MainLoop::NOTIFICATION_OS_MEMORY_WARNING);
+	}
 };
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {