Explorar o código

qt: additional fixes for reentrant shutdown

Liam %!s(int64=3) %!d(string=hai) anos
pai
achega
9ed4c13758
Modificáronse 1 ficheiros con 7 adicións e 3 borrados
  1. 7 3
      src/yuzu/main.cpp

+ 7 - 3
src/yuzu/main.cpp

@@ -1839,9 +1839,11 @@ void GMainWindow::OnEmulationStopTimeExpired() {
 
 
 void GMainWindow::OnEmulationStopped() {
 void GMainWindow::OnEmulationStopped() {
     shutdown_timer.stop();
     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) {
     if (shutdown_dialog) {
         shutdown_dialog->deleteLater();
         shutdown_dialog->deleteLater();
@@ -3029,6 +3031,8 @@ void GMainWindow::OnStopGame() {
 
 
     if (OnShutdownBegin()) {
     if (OnShutdownBegin()) {
         OnShutdownBeginDialog();
         OnShutdownBeginDialog();
+    } else {
+        OnEmulationStopped();
     }
     }
 }
 }