From 2b415292c6e9bd87faa77e9148bf2dc116a5529a Mon Sep 17 00:00:00 2001 From: Yoshi Sugawara Date: Sun, 6 Oct 2019 09:41:53 -1000 Subject: [PATCH] iOS: #9562: wrap call to get app delegate around a gcd main thread async call --- ui/drivers/cocoa/cocoa_common.m | 4 +++- ui/drivers/cocoa/cocoatouch_menu.m | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/drivers/cocoa/cocoa_common.m b/ui/drivers/cocoa/cocoa_common.m index 707581eba6..848eae740d 100644 --- a/ui/drivers/cocoa/cocoa_common.m +++ b/ui/drivers/cocoa/cocoa_common.m @@ -168,7 +168,9 @@ void *glkitview_init(void); #elif TARGET_OS_IOS -(void) showNativeMenu { - [[RetroArch_iOS get] toggleUI]; + dispatch_async(dispatch_get_main_queue(), ^{ + [[RetroArch_iOS get] toggleUI]; + }); } - (UIRectEdge)preferredScreenEdgesDeferringSystemGestures diff --git a/ui/drivers/cocoa/cocoatouch_menu.m b/ui/drivers/cocoa/cocoatouch_menu.m index 1c59fd7ca5..0a735d7698 100644 --- a/ui/drivers/cocoa/cocoatouch_menu.m +++ b/ui/drivers/cocoa/cocoatouch_menu.m @@ -717,9 +717,11 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath target:weakSelf action:@selector(menuBack)]; - [self set_rightbutton:BOXSTRING("Switch") - target:[RetroArch_iOS get] - action:@selector(showGameView)]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self set_rightbutton:BOXSTRING("Switch") + target:[RetroArch_iOS get] + action:@selector(showGameView)]; + }); } - (void) set_leftbutton:(NSString *)title target:(id)target action:(SEL)action