Skip to content

fix: Correctly dispose of everything in adapter's OnDestroy #1640

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

Merged
merged 3 commits into from
Feb 1, 2022

Conversation

simon-lemay-unity
Copy link
Contributor

MTT-2305

Some of the native containers used by the adapter are not disposed of correctly when destroying the UnityTransport component. They're disposed of correctly when shutting down gracefully (through the Shutdown method), but not if the component is destroyed without shutting it down. To fix this, we now dispose of everything in OnDestroy too.

Changelog

com.unity.netcode.adapter.utp

  • Fixed: Fixed issue with native collections not all being disposed of when destroying the component without shutting it down properly. This would result in errors in the console and memory leaks.

Testing and Documentation

  • No tests have been added.
  • No documentation changes or additions were necessary.

@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) February 1, 2022 20:09
@NoelStephensUnity NoelStephensUnity merged commit e07450f into develop Feb 1, 2022
@NoelStephensUnity NoelStephensUnity deleted the fix/adapter-ondestroy-dispose branch February 1, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants