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

This commit is contained in:
Ivan Ponomarev 2019-02-26 18:35:19 +03:00
parent 5eeb06ffd1
commit 1d576f17a7

View File

@ -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 {