From 48f39acac7e68a260c265224def79e810eac94f3 Mon Sep 17 00:00:00 2001 From: Functionable <40835042+Functionable@users.noreply.github.com> Date: Sat, 13 Dec 2025 14:02:09 +0000 Subject: [PATCH] ISO: Unload the iso_device on shutdown --- rpcs3/Emu/System.cpp | 1 + rpcs3/Loader/ISO.cpp | 9 ++++++--- rpcs3/Loader/ISO.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) 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 {