1
0
Fork 0

[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.
This commit is contained in:
Fabio Alessandrelli 2025-02-14 15:46:50 +01:00
parent b607110ad2
commit 062413fb30
1 changed files with 1 additions and 0 deletions

View File

@ -301,6 +301,7 @@ void ENetMultiplayerPeer::close() {
}
for (KeyValue<int, Ref<ENetConnection>> &E : hosts) {
E.value->flush();
E.value->destroy();
}
active_mode = MODE_NONE;