From 1aecacbad40d5caac91c32e435ba03f6156ab1e5 Mon Sep 17 00:00:00 2001 From: schm1dtmac Date: Mon, 11 May 2026 17:22:50 +0100 Subject: [PATCH] Add ensure guards (per feedback) --- rpcs3/Emu/System.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 1f6f5090c4..d0a9e15ebc 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -4068,7 +4068,7 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s if (after_kill_callback) { // Make after_kill_callback empty before call - std::exchange(after_kill_callback, nullptr)(); + std::exchange(ensure(after_kill_callback), nullptr)(); } }); })); @@ -4124,7 +4124,7 @@ game_boot_result Emulator::Restart(bool graceful, bool reset_path) else { // Execute and empty the callback - std::exchange(Emu.after_kill_callback, nullptr)(); + std::exchange(ensure(Emu.after_kill_callback), nullptr)(); } return game_boot_result::no_errors;