Skip to content

Commit

Permalink
EmulationiOSViewController: Run State functions on host thread
Browse files Browse the repository at this point in the history
  • Loading branch information
OatmealDome committed Jun 25, 2023
1 parent cc79e16 commit d6f93cb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#import "EmulationCoordinator.h"
#import "HostNotifications.h"
#import "HostQueue.h"
#import "LocalizationUtil.h"
#import "VirtualMFiControllerManager.h"

Expand Down Expand Up @@ -140,14 +141,14 @@ - (void)recreateMenu {
[UIMenu menuWithTitle:DOLCoreLocalizedString(@"Controllers") image:nil identifier:nil options:UIMenuOptionsDisplayInline children:controllerActions],
[UIMenu menuWithTitle:DOLCoreLocalizedString(@"Save State") image:nil identifier:nil options:UIMenuOptionsDisplayInline children:@[
[UIAction actionWithTitle:DOLCoreLocalizedString(@"Load State") image:[UIImage systemImageNamed:@"tray.and.arrow.down"] identifier:nil handler:^(UIAction*) {
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
DOLHostQueueRunAsync(^{
State::Load(self->_stateSlot);
});

[self.navigationController setNavigationBarHidden:true animated:true];
}],
[UIAction actionWithTitle:DOLCoreLocalizedString(@"Save State") image:[UIImage systemImageNamed:@"tray.and.arrow.up"] identifier:nil handler:^(UIAction*) {
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
DOLHostQueueRunAsync(^{
State::Save(self->_stateSlot);
});

Expand Down

0 comments on commit d6f93cb

Please sign in to comment.