[News] Added Mutex for updater check

This commit is contained in:
/dev/root 2017-02-28 19:55:22 +01:00
parent d0e760108f
commit 983e1bd8f0
2 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@ namespace Components
std::thread News::Thread; std::thread News::Thread;
std::string News::UpdaterArgs; std::string News::UpdaterArgs;
std::string News::UpdaterHash; std::string News::UpdaterHash;
std::mutex News::UpdaterMutex;
bool News::unitTest() bool News::unitTest()
{ {
@ -53,6 +54,8 @@ namespace Components
bool News::GetLatestUpdater() bool News::GetLatestUpdater()
{ {
std::lock_guard<std::mutex> _(News::UpdaterMutex);
if (Utils::IO::FileExists("updater.exe")) if (Utils::IO::FileExists("updater.exe"))
{ {
// Generate hash of local updater.exe // Generate hash of local updater.exe

View File

@ -22,6 +22,7 @@ namespace Components
static std::string UpdaterArgs; static std::string UpdaterArgs;
static std::string UpdaterHash; static std::string UpdaterHash;
static std::thread Thread; static std::thread Thread;
static std::mutex UpdaterMutex;
static bool Terminate; static bool Terminate;
static bool GetLatestUpdater(); static bool GetLatestUpdater();