Store: Remove unnecessary std::shared_ptr around the install thread

This commit is contained in:
Henrik Rydgård committed 2023-12-08 12:49:15 +01:00
1 parent 89c320fe2b
commit a929eb6c6d
2 files changed
+4 -7

No files matched your search

+3 -6
View File
@@ -171,11 +171,8 @@ void GameManager::Update() {
}
if (installDonePending_) {
if (installThread_.get() != nullptr) {
if (installThread_->joinable())
installThread_->join();
installThread_.reset();
}
if (installThread_.joinable())
installThread_.join();
installDonePending_ = false;
}
}
@@ -717,7 +714,7 @@ bool GameManager::InstallGameOnThread(const Path &url, const Path &fileName, boo
if (installInProgress_ || installDonePending_) {
return false;
}
installThread_.reset(new std::thread(std::bind(&GameManager::InstallGame, this, url, fileName, deleteAfter)));
installThread_ = std::thread(std::bind(&GameManager::InstallGame, this, url, fileName, deleteAfter));
return true;
}