From 283453b387420d07845473475d6d33424d236482 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Fri, 21 Jun 2019 14:11:21 -0700 Subject: [PATCH] Fixes checking UIView.window on background thread --- Delta/Emulation/GameViewController.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Delta/Emulation/GameViewController.swift b/Delta/Emulation/GameViewController.swift index 19fdd5d..edb8d81 100644 --- a/Delta/Emulation/GameViewController.swift +++ b/Delta/Emulation/GameViewController.swift @@ -928,7 +928,12 @@ extension GameViewController: GameViewControllerDelegate func gameViewControllerShouldResumeEmulation(_ gameViewController: DeltaCore.GameViewController) -> Bool { - let result = (self.presentedViewController == nil || self.presentedViewController?.isDisappearing == true) && !self.isSelectingSustainedButtons && self.view.window != nil + var result = false + + rst_dispatch_sync_on_main_thread { + result = (self.presentedViewController == nil || self.presentedViewController?.isDisappearing == true) && !self.isSelectingSustainedButtons && self.view.window != nil + } + return result } }