Emu: implement on_exit callback

This commit is contained in:
Megamouse 2020-12-18 12:40:25 +01:00
parent 1adec3d8e5
commit b655e4aa47
4 changed files with 18 additions and 8 deletions

View file

@ -1979,13 +1979,13 @@ bool Emulator::Quit(bool force_quit)
{
m_force_boot = false;
// Deinitialize object manager to prevent any hanging objects at program exit
if (force_quit)
// The callback is only used if we actually quit RPCS3
const auto on_exit = []()
{
// Deinitialize object manager to prevent any hanging objects at program exit
*g_fxo = {};
}
return GetCallbacks().exit(force_quit);
};
return GetCallbacks().try_to_quit(force_quit, on_exit);
}
std::string Emulator::GetFormattedTitle(double fps) const