diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/platform/ios7/ios7_osys_video.mm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm index 730715d2a1..3196f88822 100644 --- a/backends/platform/ios7/ios7_osys_video.mm +++ b/backends/platform/ios7/ios7_osys_video.mm @@ -64,13 +64,17 @@ void OSystem_iOS7::fatalError() { void OSystem_iOS7::engineInit() { EventsBaseBackend::engineInit(); // Prevent the device going to sleep during game play (and in particular cut scenes) - [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; + }); } void OSystem_iOS7::engineDone() { EventsBaseBackend::engineDone(); // Allow the device going to sleep if idle while in the Launcher - [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; + }); } void OSystem_iOS7::initVideoContext() { |