From f44c60321ec767b6e881160d4960345d678edf78 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 5b5b6fed8..f7321258c 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