1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 12:39:11 +00:00

(svn r23752) -Fix [FS#4938]: missing locking causing crash is extreme case when being in the MP lobby

This commit is contained in:
rubidium
2012-01-04 22:11:26 +00:00
parent 531e501b5a
commit c530450193

View File

@@ -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 */