From 3424d2460542ecf7f6868052e93ebbb48c6d082a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 26 Mar 2024 15:10:06 +0100 Subject: [PATCH] Fix hang when trying to load non-existing file or folder. --- UI/GameInfoCache.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 876794f79a..7998a3343a 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -451,12 +451,11 @@ public: void Run() override { // An early-return will result in the destructor running, where we can set // flags like working and pending. - if (!info_->CreateLoader()) { - return; - } - - // In case of a remote file, check if it actually exists before locking. - if (!info_->GetFileLoader() || !info_->GetFileLoader()->Exists()) { + if (!info_->CreateLoader() || !info_->GetFileLoader() || !info_->GetFileLoader()->Exists()) { + // Mark everything requested as done, so + std::unique_lock lock(info_->lock); + info_->MarkReadyNoLock(flags_); + ERROR_LOG(LOADER, "Failed getting game info."); return; }