diff options
author | rubidium <rubidium@openttd.org> | 2009-04-08 21:03:00 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-04-08 21:03:00 +0000 |
commit | e779c56e31010fe2036f049e875d2de58b4fc7d3 (patch) | |
tree | f488b4c89241ad346a14b276510b82b7a43a8048 | |
parent | 1d4318c0d16cb6017fc41027fa96d042851dbf10 (diff) | |
download | openttd-e779c56e31010fe2036f049e875d2de58b4fc7d3.tar.xz |
(svn r15989) -Fix (r15987: segfault due to uninitialised sockets.
-rw-r--r-- | src/network/network.cpp | 2 | ||||
-rw-r--r-- | src/network/network_udp.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp index 5fd68650b..e442e46d6 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -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"); diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index c1da7df43..b59ebfb7d 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -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); |