summaryrefslogtreecommitdiff
path: root/platform/iphone
diff options
context:
space:
mode:
authorIvan Ponomarev <ivan.ponomarev@synesis.ru>2019-02-26 18:35:19 +0300
committerIvan Ponomarev <ivan.ponomarev@synesis.ru>2019-02-26 18:36:20 +0300
commit1d576f17a78c07201bdab4bce0a75639a8cb42cf (patch)
tree716f61454aa456f1b71fd395b47eeb524a6a898f /platform/iphone
parent5eeb06ffd1bf9cc79142760c372c17cd858cbe49 (diff)
Fixed possible crash on iOS in applicationDidReceiveMemoryWarning method: event loop may be null when it's called.
Diffstat (limited to 'platform/iphone')
-rw-r--r--platform/iphone/app_delegate.mm6
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm
index bb0c11c767..d160553050 100644
--- a/platform/iphone/app_delegate.mm
+++ b/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 {