mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-05-12 16:19:44 -06:00
Fix restart-loops upon restart-then-quit
(std::exchange one-liner courtesy of Elad <18193363+elad335@users.noreply.github.com>)
This commit is contained in:
parent
6fa7efbcc3
commit
9256a0277f
@ -4068,8 +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
|
||||
const auto callback = std::move(after_kill_callback);
|
||||
callback();
|
||||
std::exchange(after_kill_callback, nullptr)();
|
||||
}
|
||||
});
|
||||
}));
|
||||
@ -4125,7 +4124,7 @@ game_boot_result Emulator::Restart(bool graceful, bool reset_path)
|
||||
else
|
||||
{
|
||||
// Execute and empty the callback
|
||||
::as_rvalue(std::move(Emu.after_kill_callback))();
|
||||
std::exchange(Emu.after_kill_callback, nullptr)();
|
||||
}
|
||||
|
||||
return game_boot_result::no_errors;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user