From d03d2f0b2b99e1b7f6e717cd4dc828d65e3feaf0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 29 Dec 2017 08:56:27 -0800 Subject: [PATCH] UI: Check existance outside of game info lock. Improves behavior when remote files timeout, at least they won't block FlushBGs(). --- UI/GameInfoCache.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index aed2220376..83b97f2b72 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -228,7 +228,7 @@ bool GameInfo::LoadFromPath(const std::string &gamePath) { title = File::GetFilename(filePath_); } - return fileLoader ? fileLoader->Exists() : true; + return true; } std::shared_ptr GameInfo::GetFileLoader() { @@ -358,6 +358,11 @@ public: void run() override { if (!info_->LoadFromPath(gamePath_)) return; + // In case of a remote file, check if it actually exists before locking. + if (!info_->GetFileLoader()->Exists()) { + info_->pending = false; + return; + } info_->working = true; info_->fileType = Identify_File(info_->GetFileLoader().get());