summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-12-13 03:38:20 +0100
committerLiam <byteslice@airmail.cc>2022-12-13 03:38:20 +0100
commit179adee396e6b8480d52be5314979830beebfbc1 (patch)
treea0cbfaf66a546f3717db1c3090af39d909f9800c /src
parentlet games gracefully exit (diff)
downloadyuzu-179adee396e6b8480d52be5314979830beebfbc1.tar
yuzu-179adee396e6b8480d52be5314979830beebfbc1.tar.gz
yuzu-179adee396e6b8480d52be5314979830beebfbc1.tar.bz2
yuzu-179adee396e6b8480d52be5314979830beebfbc1.tar.lz
yuzu-179adee396e6b8480d52be5314979830beebfbc1.tar.xz
yuzu-179adee396e6b8480d52be5314979830beebfbc1.tar.zst
yuzu-179adee396e6b8480d52be5314979830beebfbc1.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/bootmanager.h11
-rw-r--r--src/yuzu/main.cpp6
2 files changed, 5 insertions, 12 deletions
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h
index c2b127f19..f0edad6e4 100644
--- a/src/yuzu/bootmanager.h
+++ b/src/yuzu/bootmanager.h
@@ -11,7 +11,6 @@
#include <QImage>
#include <QStringList>
#include <QThread>
-#include <QTimer>
#include <QTouchEvent>
#include <QWidget>
@@ -85,17 +84,9 @@ public:
}
/**
- * Requests for the emulation thread to stop running
+ * Requests for the emulation thread to immediately stop running
*/
- void RequestStop() {
- QTimer::singleShot(5000, this, &EmuThread::ForceStop);
- }
-
-private slots:
void ForceStop() {
- if (!IsRunning()) {
- return;
- }
LOG_WARNING(Frontend, "Force stopping EmuThread");
stop_source.request_stop();
SetRunning(false);
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index b38957d9a..b3ae03eaf 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1792,12 +1792,14 @@ void GMainWindow::ShutdownGame() {
discord_rpc->Pause();
RequestGameExit();
- emu_thread->RequestStop();
emit EmulationStopping();
// Wait for emulation thread to complete and delete it
- emu_thread->wait();
+ if (!emu_thread->wait(5000)) {
+ emu_thread->ForceStop();
+ emu_thread->wait();
+ }
emu_thread = nullptr;
emulation_running = false;