Skip to content

Commit 062413f

Browse files
committed
[ENet] Explicitely destroy hosts on close
To ensure we free up the UDP port even if a script is holding a reference to the underlying host, we need to explicitly destroy it on close.
1 parent b607110 commit 062413f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

modules/enet/enet_multiplayer_peer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ void ENetMultiplayerPeer::close() {
301301
}
302302
for (KeyValue<int, Ref<ENetConnection>> &E : hosts) {
303303
E.value->flush();
304+
E.value->destroy();
304305
}
305306

306307
active_mode = MODE_NONE;

0 commit comments

Comments
 (0)