diff --git a/scwx-qt/source/scwx/qt/manager/update_manager.cpp b/scwx-qt/source/scwx/qt/manager/update_manager.cpp index fe96936f..f6eba5ef 100644 --- a/scwx-qt/source/scwx/qt/manager/update_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/update_manager.cpp @@ -24,7 +24,7 @@ static const std::string kScwxReleaseEndpoint { class UpdateManager::Impl { public: - explicit Impl(UpdateManager* self) : self_ {self}, releases_ {} {} + explicit Impl(UpdateManager* self) : self_ {self} {} ~Impl() {} @@ -38,9 +38,11 @@ public: UpdateManager* self_; - std::vector releases_; - types::gh::Release latestRelease_; - std::string latestVersion_; + std::mutex updateMutex_ {}; + + std::vector releases_ {}; + types::gh::Release latestRelease_ {}; + std::string latestVersion_ {}; }; UpdateManager::UpdateManager() : p(std::make_unique(this)) {} @@ -97,6 +99,8 @@ boost::json::value UpdateManager::Impl::ParseResponseText(const std::string& s) bool UpdateManager::CheckForUpdates(const std::string& currentVersion) { + std::unique_lock lock(p->updateMutex_); + logger_->info("Checking for updates"); // Query GitHub for releases