diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-01-09 16:21:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 16:21:27 -0500 |
commit | 3be83121207f771de8d7806b309d5b10a394b3e7 (patch) | |
tree | 14e1e46ae48584c7f18197e8ec7b9ace10de8b08 | |
parent | 948ac976d101229d49cf830a7df66690dd3640e5 (diff) | |
parent | 9ed4c1375885191971794315cffae5f6a8dd9e34 (diff) |
Merge pull request #9569 from liamwhite/shutdown-wars
qt: additional fixes for reentrant shutdown
-rw-r--r-- | src/yuzu/main.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index c55f81c2f..2ea3b7d59 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1839,9 +1839,11 @@ void GMainWindow::OnEmulationStopTimeExpired() { void GMainWindow::OnEmulationStopped() { shutdown_timer.stop(); - emu_thread->disconnect(); - emu_thread->wait(); - emu_thread = nullptr; + if (emu_thread) { + emu_thread->disconnect(); + emu_thread->wait(); + emu_thread.reset(); + } if (shutdown_dialog) { shutdown_dialog->deleteLater(); @@ -3029,6 +3031,8 @@ void GMainWindow::OnStopGame() { if (OnShutdownBegin()) { OnShutdownBeginDialog(); + } else { + OnEmulationStopped(); } } |