Permalink
Browse files

UI: Check existance outside of game info lock.

Improves behavior when remote files timeout, at least they won't
block FlushBGs().
  • Loading branch information...
unknownbrackets committed Dec 29, 2017
1 parent d00dcb4 commit d03d2f0b2b99e1b7f6e717cd4dc828d65e3feaf0
Showing with 6 additions and 1 deletion.
  1. +6 −1 UI/GameInfoCache.cpp
View
@@ -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<FileLoader> GameInfo::GetFileLoader() {
@@ -358,6 +358,11 @@ class GameInfoWorkItem : public PrioritizedWorkQueueItem {
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());

0 comments on commit d03d2f0

Please sign in to comment.