Skip to content

Commit

Permalink
Fix hang when trying to load non-existing file or folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Mar 26, 2024
1 parent 22c9437 commit 3424d24
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions UI/GameInfoCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,11 @@ class GameInfoWorkItem : public Task {
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<std::mutex> lock(info_->lock);
info_->MarkReadyNoLock(flags_);
ERROR_LOG(LOADER, "Failed getting game info.");
return;
}

Expand Down

0 comments on commit 3424d24

Please sign in to comment.