[Core] Only wait on the main thread if it actually exists.

This commit is contained in:
gibbed 2019-08-03 23:48:05 -05:00
parent 4970fc8673
commit e48f4ce004
1 changed files with 3 additions and 1 deletions

View File

@ -581,7 +581,9 @@ bool Emulator::ExceptionCallback(Exception* ex) {
void Emulator::WaitUntilExit() {
while (true) {
xe::threading::Wait(main_thread_->thread(), false);
if (main_thread_) {
xe::threading::Wait(main_thread_->thread(), false);
}
if (restoring_) {
restore_fence_.Wait();