diff --git a/Core/FileSystems/MetaFileSystem.cpp b/Core/FileSystems/MetaFileSystem.cpp index b8ebc9238e..6ecd36226c 100644 --- a/Core/FileSystems/MetaFileSystem.cpp +++ b/Core/FileSystems/MetaFileSystem.cpp @@ -298,6 +298,15 @@ void MetaFileSystem::UnmountAll() { currentDir.clear(); } +void MetaFileSystem::Unmount(std::string prefix) { + for (auto iter = fileSystems.begin(); iter != fileSystems.end(); iter++) { + if (iter->prefix == prefix) { + fileSystems.erase(iter); + return; + } + } +} + bool MetaFileSystem::Remount(std::string prefix, std::shared_ptr system) { std::lock_guard guard(lock); for (auto &it : fileSystems) { diff --git a/Core/FileSystems/MetaFileSystem.h b/Core/FileSystems/MetaFileSystem.h index 84ea60a44a..f980fc1900 100644 --- a/Core/FileSystems/MetaFileSystem.h +++ b/Core/FileSystems/MetaFileSystem.h @@ -62,6 +62,7 @@ public: bool Remount(std::string prefix, std::shared_ptr system); void UnmountAll(); + void Unmount(std::string prefix); // The pointer returned from these are for temporary usage only. Do not store. IFileSystem *GetSystem(const std::string &prefix); diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 3b99c2d2d3..c856794110 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -775,7 +775,12 @@ void __IoShutdown() { } asyncDefaultPriority = -1; - pspFileSystem.UnmountAll(); + pspFileSystem.Unmount("ms0:"); + pspFileSystem.Unmount("fatms0:"); + pspFileSystem.Unmount("fatms:"); + pspFileSystem.Unmount("pfat0:"); + pspFileSystem.Unmount("flash0:"); + pspFileSystem.Unmount("exdata0:"); MemoryStick_Shutdown(); memStickCallbacks.clear();