aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/filesystem/filesystem.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-12-03 17:11:26 -0500
committerGitHub <noreply@github.com>2018-12-03 17:11:26 -0500
commitf6b22d9251bd45c7bafec2214911f7a818e99cbf (patch)
treed79ba08d69fbd9686a8f49c9282c0c8a74af3609 /src/core/hle/service/filesystem/filesystem.cpp
parent8a12daac8c15179d86b2050ad1218a9e7cb7c93e (diff)
parentdb4523f1ece642475d58f8764863c8930a0812e3 (diff)
Merge pull request #1835 from lioncash/cache-global
filesystem: De-globalize registered_cache_union
Diffstat (limited to 'src/core/hle/service/filesystem/filesystem.cpp')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 3bdff4036..b1490e6fa 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -341,20 +341,9 @@ ResultVal<FileSys::VirtualDir> OpenSDMC() {
return sdmc_factory->Open();
}
-std::shared_ptr<FileSys::RegisteredCacheUnion> registered_cache_union;
-
-std::shared_ptr<FileSys::RegisteredCacheUnion> GetUnionContents() {
- if (registered_cache_union == nullptr) {
- registered_cache_union =
- std::make_shared<FileSys::RegisteredCacheUnion>(std::vector<FileSys::RegisteredCache*>{
- GetSystemNANDContents(), GetUserNANDContents(), GetSDMCContents()});
- }
-
- return registered_cache_union;
-}
-
-void ClearUnionContents() {
- registered_cache_union = nullptr;
+FileSys::RegisteredCacheUnion GetUnionContents() {
+ return FileSys::RegisteredCacheUnion{
+ {GetSystemNANDContents(), GetUserNANDContents(), GetSDMCContents()}};
}
FileSys::RegisteredCache* GetSystemNANDContents() {
@@ -407,7 +396,6 @@ void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) {
bis_factory = nullptr;
save_data_factory = nullptr;
sdmc_factory = nullptr;
- ClearUnionContents();
}
auto nand_directory = vfs.OpenDirectory(FileUtil::GetUserPath(FileUtil::UserPath::NANDDir),