瀏覽代碼

Merge pull request #26313 from ivanarh/master

iOS: Fixed possible crash in applicationDidReceiveMemoryWarning
Rémi Verschelde 6 年之前
父節點
當前提交
ce114e35dd
共有 1 個文件被更改,包括 4 次插入2 次删除
  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 {