Skip to content

Commit

Permalink
Fix shutdown because of Discord deinitializer
Browse files Browse the repository at this point in the history
  • Loading branch information
imxieyi committed Jun 11, 2019
1 parent 364b447 commit 1affe0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ios/ViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,15 @@ - (void)viewDidLoad {
time_update();
}

threadStopped = true;

ILOG("Emulation thread shutting down\n");
NativeShutdownGraphics();

// Also ask the main thread to stop, so it doesn't hang waiting for a new frame.
ILOG("Emulation thread stopping\n");
graphicsContext->StopThread();

threadStopped = true;
});
}

Expand Down
5 changes: 4 additions & 1 deletion ios/main.mm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ bool System_GetPropertyBool(SystemProperty prop) {

void System_SendMessage(const char *command, const char *parameter) {
if (!strcmp(command, "finish")) {
exit(0);
dispatch_async(dispatch_get_main_queue(), ^{
[sharedViewController shutdown];
exit(0);
});
}
}

Expand Down

0 comments on commit 1affe0b

Please sign in to comment.