Potentially reuse a cached file loader.

Although right now we always dispose, this just makes it so we could more
easily garbage collect them if we wanted.
This commit is contained in:
Unknown W. Brackets 2015-06-09 23:19:09 -07:00
parent 2d0bc5eeee
commit 4fa529db50

View File

@ -166,11 +166,14 @@ u64 GameInfo::GetInstallDataSizeInBytes() {
}
bool GameInfo::LoadFromPath(const std::string &gamePath) {
delete fileLoader;
fileLoader = ConstructFileLoader(gamePath);
filePath_ = gamePath;
// No need to rebuild if we already have it loaded.
if (filePath_ != gamePath) {
delete fileLoader;
fileLoader = ConstructFileLoader(gamePath);
filePath_ = gamePath;
}
return fileLoader->Exists();
return GetFileLoader()->Exists();
}
FileLoader *GameInfo::GetFileLoader() {