aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/bootmanager.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-12-16 11:57:33 -0500
committerGitHub <noreply@github.com>2022-12-16 11:57:33 -0500
commit36950ef442fec354e3f8bbe683f6509f43cc34fe (patch)
treef744a93874c713608617364205fe70605b6e63ec /src/yuzu/bootmanager.cpp
parent657720ad642da04e1061d77e6b08beb98aa6435c (diff)
parente9f112183ba5a986d294165776cae9e72026fb46 (diff)
Merge pull request #8605 from devsnek/graceful-shutdown
let games gracefully exit
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r--src/yuzu/bootmanager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 1a47fb9c96..642f966908 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -79,6 +79,11 @@ void EmuThread::run() {
system.GetCpuManager().OnGpuReady();
+ system.RegisterExitCallback([this]() {
+ stop_source.request_stop();
+ SetRunning(false);
+ });
+
// Holds whether the cpu was running during the last iteration,
// so that the DebugModeLeft signal can be emitted before the
// next execution step