mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Netconsole: fix race condition caused by misplaced mutex
Mutex should be locked before IsConnected(), as IsConnected() accesses CSocketCreator which checks a vector (not thread safe), lock the mutex in the correct place.
This commit is contained in:
parent
1674200764
commit
869741b3b3
@ -278,10 +278,10 @@ bool CNetCon::RunFrame(void)
|
||||
{
|
||||
if (IsInitialized())
|
||||
{
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
|
||||
if (IsConnected())
|
||||
{
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
|
||||
CConnectedNetConsoleData& pData = GetSocketCreator()->GetAcceptedSocketData(0);
|
||||
Recv(pData);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user