summaryrefslogtreecommitdiff
path: root/src/network/network_udp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/network_udp.cpp')
-rw-r--r--src/network/network_udp.cpp3
1 files changed, 3 insertions, 0 deletions
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);