mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 08:51:28 +12:00
Perform cleanup after Emulator::Load failures
This commit is contained in:
parent
dc48944979
commit
c887865d54
2 changed files with 14 additions and 6 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue