mirror of https://github.com/OpenTTD/OpenTTD
(svn r23752) -Fix [FS#4938]: missing locking causing crash is extreme case when being in the MP lobby
parent
531e501b5a
commit
c530450193
|
@ -678,6 +678,8 @@ void NetworkUDPClose()
|
|||
/** Receive the UDP packets. */
|
||||
void NetworkBackgroundUDPLoop()
|
||||
{
|
||||
_network_udp_mutex->BeginCritical();
|
||||
|
||||
if (_network_udp_server) {
|
||||
_udp_server_socket->ReceivePackets();
|
||||
_udp_master_socket->ReceivePackets();
|
||||
|
@ -685,6 +687,8 @@ void NetworkBackgroundUDPLoop()
|
|||
_udp_client_socket->ReceivePackets();
|
||||
if (_network_udp_broadcast > 0) _network_udp_broadcast--;
|
||||
}
|
||||
|
||||
_network_udp_mutex->EndCritical();
|
||||
}
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
|
Loading…
Reference in New Issue