diff options
author | bunnei <bunneidev@gmail.com> | 2018-11-16 16:02:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 16:02:37 +0100 |
commit | 5b8f70ea2ed13e0f2155cc3435647887a15d2915 (patch) | |
tree | 710840cf895216a59e2a4654d5c049b61837ab10 /src/core/hle | |
parent | Merge pull request #1676 from lioncash/warn (diff) | |
parent | game_list: Make add-ons column optional (diff) | |
download | yuzu-5b8f70ea2ed13e0f2155cc3435647887a15d2915.tar yuzu-5b8f70ea2ed13e0f2155cc3435647887a15d2915.tar.gz yuzu-5b8f70ea2ed13e0f2155cc3435647887a15d2915.tar.bz2 yuzu-5b8f70ea2ed13e0f2155cc3435647887a15d2915.tar.lz yuzu-5b8f70ea2ed13e0f2155cc3435647887a15d2915.tar.xz yuzu-5b8f70ea2ed13e0f2155cc3435647887a15d2915.tar.zst yuzu-5b8f70ea2ed13e0f2155cc3435647887a15d2915.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 13 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 554474cf6..5d6294016 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -329,9 +329,16 @@ ResultVal<FileSys::VirtualDir> OpenSDMC() { return sdmc_factory->Open(); } -std::unique_ptr<FileSys::RegisteredCacheUnion> GetUnionContents() { - return std::make_unique<FileSys::RegisteredCacheUnion>(std::vector<FileSys::RegisteredCache*>{ - GetSystemNANDContents(), GetUserNANDContents(), GetSDMCContents()}); +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; } FileSys::RegisteredCache* GetSystemNANDContents() { diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index e38f02869..ff9182e84 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h @@ -48,7 +48,7 @@ ResultVal<FileSys::VirtualDir> OpenSaveData(FileSys::SaveDataSpaceId space, ResultVal<FileSys::VirtualDir> OpenSaveDataSpace(FileSys::SaveDataSpaceId space); ResultVal<FileSys::VirtualDir> OpenSDMC(); -std::unique_ptr<FileSys::RegisteredCacheUnion> GetUnionContents(); +std::shared_ptr<FileSys::RegisteredCacheUnion> GetUnionContents(); FileSys::RegisteredCache* GetSystemNANDContents(); FileSys::RegisteredCache* GetUserNANDContents(); |