diff --git a/rpcs3/Emu/Cell/lv2/sys_process.cpp b/rpcs3/Emu/Cell/lv2/sys_process.cpp index 4742634bd7..8ab88d7bac 100644 --- a/rpcs3/Emu/Cell/lv2/sys_process.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_process.cpp @@ -461,7 +461,6 @@ void _sys_process_exit2(ppu_thread& ppu, s32 status, vm::ptr ar if (res != game_boot_result::no_errors) { sys_process.fatal("Failed to boot from exitspawn! (path=\"%s\", error=%s)", path, res); - Emu.Kill(); } }); diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 692a232563..b093e026a9 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -672,11 +672,6 @@ game_boot_result Emulator::BootGame(const std::string& path, const std::string& auto error = Load(title_id, add_only); - if (is_error(error)) - { - m_ar.reset(); - } - if (g_cfg.savestate.suspend_emu && m_ar) { fs::remove_file(path); @@ -765,6 +760,20 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool sys_log.notice("Selected config: mode=%s, path=\"%s\"", m_config_mode, m_config_path); sys_log.notice("Path: %s", m_path); + struct cleanup_t + { + Emulator* _this; + bool cleanup = true; + + ~cleanup_t() + { + if (cleanup && _this->IsStopped()) + { + _this->Kill(false); + } + } + } cleanup{this}; + { Init(add_only);