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 | |
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 'src/core')
-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 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() { diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 6ca5c5636..6f3e0cd03 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h @@ -47,7 +47,7 @@ ResultVal<FileSys::VirtualDir> OpenSaveData(FileSys::SaveDataSpaceId space, FileSys::SaveDataDescriptor save_struct); ResultVal<FileSys::VirtualDir> OpenSDMC(); -std::unique_ptr<FileSys::RegisteredCacheUnion> GetUnionContents(); +std::shared_ptr<FileSys::RegisteredCacheUnion> GetUnionContents(); FileSys::RegisteredCache* GetSystemNANDContents(); FileSys::RegisteredCache* GetUserNANDContents(); |