summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/filesystem
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-12-03 23:11:26 +0100
committerGitHub <noreply@github.com>2018-12-03 23:11:26 +0100
commitf6b22d9251bd45c7bafec2214911f7a818e99cbf (patch)
treed79ba08d69fbd9686a8f49c9282c0c8a74af3609 /src/core/hle/service/filesystem
parentMerge pull request #1822 from ReinUsesLisp/glsl-scope (diff)
parentfilesystem: De-globalize registered_cache_union (diff)
downloadyuzu-f6b22d9251bd45c7bafec2214911f7a818e99cbf.tar
yuzu-f6b22d9251bd45c7bafec2214911f7a818e99cbf.tar.gz
yuzu-f6b22d9251bd45c7bafec2214911f7a818e99cbf.tar.bz2
yuzu-f6b22d9251bd45c7bafec2214911f7a818e99cbf.tar.lz
yuzu-f6b22d9251bd45c7bafec2214911f7a818e99cbf.tar.xz
yuzu-f6b22d9251bd45c7bafec2214911f7a818e99cbf.tar.zst
yuzu-f6b22d9251bd45c7bafec2214911f7a818e99cbf.zip
Diffstat (limited to 'src/core/hle/service/filesystem')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp18
-rw-r--r--src/core/hle/service/filesystem/filesystem.h3
2 files changed, 4 insertions, 17 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),
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h
index 278cf90ab..965414be0 100644
--- a/src/core/hle/service/filesystem/filesystem.h
+++ b/src/core/hle/service/filesystem/filesystem.h
@@ -48,8 +48,7 @@ ResultVal<FileSys::VirtualDir> OpenSaveData(FileSys::SaveDataSpaceId space,
ResultVal<FileSys::VirtualDir> OpenSaveDataSpace(FileSys::SaveDataSpaceId space);
ResultVal<FileSys::VirtualDir> OpenSDMC();
-std::shared_ptr<FileSys::RegisteredCacheUnion> GetUnionContents();
-void ClearUnionContents();
+FileSys::RegisteredCacheUnion GetUnionContents();
FileSys::RegisteredCache* GetSystemNANDContents();
FileSys::RegisteredCache* GetUserNANDContents();