[News] Added Mutex for updater check
This commit is contained in:
parent
d0e760108f
commit
983e1bd8f0
@ -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
|
||||||
|
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user