1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix possible thread race on sending packet from two threads

This commit is contained in:
Ivan Savenko
2024-02-25 20:05:28 +02:00
parent 8647abb94b
commit 6901945b6e
4 changed files with 4 additions and 2 deletions

View File

@@ -70,6 +70,8 @@ CConnection::~CConnection() = default;
void CConnection::sendPack(const CPack * pack)
{
boost::mutex::scoped_lock lock(writeMutex);
auto connectionPtr = networkConnection.lock();
if (!connectionPtr)