UI: Check existance outside of game info lock.

Improves behavior when remote files timeout, at least they won't
block FlushBGs().
This commit is contained in:
Unknown W. Brackets 2017-12-29 08:56:27 -08:00
parent d00dcb4400
commit d03d2f0b2b

View File

@ -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 @@ 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());