Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENet] Explicitely destroy hosts on close #102861

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

Faless
Copy link
Collaborator

@Faless Faless commented Feb 14, 2025

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 is a partial fix to #102822 .

We can't really properly fix it if C# keeps references to RefCounted objects longer than their lifetime, but we can at least make sure that if you hold a reference to the underlying host, and you explicitly call ENetMultiplayerPeer::close, the underlying socket gets properly closed.

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.
@akien-mga akien-mga merged commit 5da66eb into godotengine:master Feb 14, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants