Skip to content

fix: Make NetworkManager.Shutdown idempotent #1877

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 4 commits into from
Apr 27, 2022

Conversation

simon-lemay-unity
Copy link
Contributor

If calling Shutdown on a NetworkManager that's already shut down, the m_ShuttingDown flag would still be set to true. But if the NetworkManager is not running then ShutdownInternal won't get an opportunity to run and clear that flag until the next time the NetworkManager is started.

The result is that calling Shutdown on a NetworkManager that's not running will cause an immediate shutdown the next time it does run. That's unlikely to be the desired behavior here.

The fix is to not set m_ShuttingDown if the NetworkManager is not running. This makes Shutdown idempotent; calling it again multiple times produces no effect.

Changelog

  • Fixed: Fixed an issue where calling Shutdown on a NetworkManager that was already shut down would cause an immediate shutdown the next time it was started (basically the fix makes Shutdown idempotent).

Testing and Documentation

  • Includes integration test.
  • No documentation changes or additions were necessary.

Comment on lines +11 to +12
### Removed
- Removed `SIPTransport` (#1870)
Copy link
Contributor Author

@simon-lemay-unity simon-lemay-unity Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this entry had been accidently put under the 1.0.0-pre.7 section.

@jeffreyrainy
Copy link
Contributor

Just linking: This should fix #1595

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.

2 participants