From 786ec95e5d162e1568b0c3eaf532e873b3e0715e Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Mon, 18 Jul 2022 00:41:29 -0700 Subject: let games gracefully exit --- src/yuzu/bootmanager.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/yuzu/bootmanager.cpp') diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 5b5b6fed86..f7321258c2 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -80,6 +80,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 -- cgit v1.2.3