Empty kill and init callback before calling them

This commit is contained in:
Eladash 2023-06-29 08:42:21 +03:00 committed by Ivan
parent 554b27a82a
commit a03dd44924
5 changed files with 37 additions and 25 deletions

View file

@ -2893,8 +2893,9 @@ void Emulator::Kill(bool allow_autoexit, bool savestate)
if (after_kill_callback)
{
after_kill_callback();
after_kill_callback = nullptr;
// Make after_kill_callback empty before call
const auto callback = std::move(after_kill_callback);
callback();
}
});
}));