From 8bc745fb55c55623d8ada90198db8cdc8b6be8e0 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 27 Sep 2017 19:06:42 +0200 Subject: IOS: Improve iOS 11 compatibility --- backends/platform/ios7/ios7_app_delegate.mm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'backends/platform/ios7/ios7_app_delegate.mm') diff --git a/backends/platform/ios7/ios7_app_delegate.mm b/backends/platform/ios7/ios7_app_delegate.mm index 88d0a8925e..014275d116 100644 --- a/backends/platform/ios7/ios7_app_delegate.mm +++ b/backends/platform/ios7/ios7_app_delegate.mm @@ -39,14 +39,6 @@ return self; } -- (void)mainLoop:(id)param { - @autoreleasepool { - iOS7_main(iOS7_argc, iOS7_argv); - } - - exit(0); -} - - (void)applicationDidFinishLaunching:(UIApplication *)application { CGRect rect = [[UIScreen mainScreen] bounds]; @@ -78,7 +70,12 @@ name:@"UIDeviceOrientationDidChangeNotification" object:nil]; - [NSThread detachNewThreadSelector:@selector(mainLoop:) toTarget:self withObject:nil]; + // Force creation of the shared instance on the main thread + iOS7_buildSharedOSystemInstance(); + + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + iOS7_main(iOS7_argc, iOS7_argv); + }); } - (void)applicationWillResignActive:(UIApplication *)application { -- cgit v1.2.3