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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user