1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Properly lock UI mutex on accessing GUI state from network thread

This commit is contained in:
Ivan Savenko
2024-02-03 22:24:32 +02:00
parent 80fc2bb695
commit 1b6ac1052a
4 changed files with 46 additions and 30 deletions

View File

@@ -261,10 +261,11 @@ bool CVCMIServer::prepareToStartGame()
Load::ProgressAccumulator progressTracking;
Load::Progress current(1);
progressTracking.include(current);
auto currentProgress = std::numeric_limits<Load::Type>::max();
auto progressTrackingThread = boost::thread([this, &progressTracking, &currentProgress]()
auto progressTrackingThread = boost::thread([this, &progressTracking]()
{
auto currentProgress = std::numeric_limits<Load::Type>::max();
while(!progressTracking.finished())
{
if(progressTracking.get() != currentProgress)