diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-02 01:24:32 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-02 01:24:32 +0100 |
commit | 8f183a47dd3dca5247b893960afd09b6f603ae87 (patch) | |
tree | 9926868be3c0e43cc0e746dfbd0ab91426bc5c8c /src/core/hle/service/filesystem/filesystem.cpp | |
parent | file_sys: Use common KeyManager in NCA container types (diff) | |
download | yuzu-8f183a47dd3dca5247b893960afd09b6f603ae87.tar yuzu-8f183a47dd3dca5247b893960afd09b6f603ae87.tar.gz yuzu-8f183a47dd3dca5247b893960afd09b6f603ae87.tar.bz2 yuzu-8f183a47dd3dca5247b893960afd09b6f603ae87.tar.lz yuzu-8f183a47dd3dca5247b893960afd09b6f603ae87.tar.xz yuzu-8f183a47dd3dca5247b893960afd09b6f603ae87.tar.zst yuzu-8f183a47dd3dca5247b893960afd09b6f603ae87.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index e32a7c48e..ad865751f 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -319,9 +319,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() { |