diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index f7659af23a..0325807e1e 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -3886,6 +3886,7 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s disc.clear(); klic.clear(); hdd1.clear(); + unload_iso(); init_mem_containers = nullptr; m_config_path.clear(); m_config_mode = cfg_mode::custom; diff --git a/rpcs3/Loader/ISO.cpp b/rpcs3/Loader/ISO.cpp index f97d7fd026..bee017a59d 100644 --- a/rpcs3/Loader/ISO.cpp +++ b/rpcs3/Loader/ISO.cpp @@ -602,9 +602,12 @@ void iso_dir::rewind() void load_iso(const std::string& path) { - fs::set_virtual_device("iso_overlay_fs_dev", - stx::shared_ptr()); - fs::set_virtual_device("iso_overlay_fs_dev", stx::make_shared(path)); } + +void unload_iso() +{ + fs::set_virtual_device("iso_overlay_fs_dev", + stx::shared_ptr()); +} diff --git a/rpcs3/Loader/ISO.h b/rpcs3/Loader/ISO.h index bc3d1faa2b..f986899db8 100644 --- a/rpcs3/Loader/ISO.h +++ b/rpcs3/Loader/ISO.h @@ -7,6 +7,7 @@ bool is_file_iso(const std::string& path); bool is_file_iso(const fs::file& path); void load_iso(const std::string& path); +void unload_iso(); struct iso_extent_info {