1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-23 14:39:08 +00:00

(svn r15989) -Fix (r15987: segfault due to uninitialised sockets.

This commit is contained in:
rubidium
2009-04-08 21:03:00 +00:00
parent 1d4318c0d1
commit e779c56e31
2 changed files with 4 additions and 1 deletions

View File

@@ -587,7 +587,6 @@ static void NetworkClose()
_listensockets.Clear();
DEBUG(net, 1, "Closed listener");
}
NetworkUDPClose();
TCPConnecter::KillAll();
@@ -1088,6 +1087,7 @@ void NetworkStartUp()
void NetworkShutDown()
{
NetworkDisconnect();
NetworkUDPClose();
DEBUG(net, 3, "[core] shutting down network");

View File

@@ -520,6 +520,9 @@ void NetworkUDPAdvertise()
void NetworkUDPInitialize()
{
/* If not closed, then do it. */
if (_udp_server_socket != NULL) NetworkUDPClose();
DEBUG(net, 1, "[udp] initializing listeners");
assert(_udp_client_socket == NULL && _udp_server_socket == NULL && _udp_master_socket == NULL);