-
Notifications
You must be signed in to change notification settings - Fork 461
fix: cleaning up connected clients upon shutdown [MTT-1573] #1945
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
Changes from 3 commits
b28ecc7
5cb03e6
09845a8
c9a0eda
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -765,12 +765,7 @@ private void Initialize(bool server) | |
| #endif | ||
| LocalClientId = ulong.MaxValue; | ||
|
|
||
| PendingClients.Clear(); | ||
| m_ConnectedClients.Clear(); | ||
| m_ConnectedClientsList.Clear(); | ||
| m_ConnectedClientIds.Clear(); | ||
| LocalClient = null; | ||
| NetworkObject.OrphanChildren.Clear(); | ||
| ClearClients(); | ||
|
|
||
| // Create spawn manager instance | ||
| SpawnManager = new NetworkSpawnManager(this); | ||
|
|
@@ -862,6 +857,16 @@ private void Initialize(bool server) | |
| NetworkConfig.NetworkTransport.Initialize(this); | ||
| } | ||
|
|
||
| private void ClearClients() | ||
| { | ||
| PendingClients.Clear(); | ||
| m_ConnectedClients.Clear(); | ||
| m_ConnectedClientsList.Clear(); | ||
| m_ConnectedClientIds.Clear(); | ||
| LocalClient = null; | ||
| NetworkObject.OrphanChildren.Clear(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Starts a server | ||
| /// </summary> | ||
|
|
@@ -1301,6 +1306,8 @@ internal void ShutdownInternal() | |
| IsListening = false; | ||
| m_ShuttingDown = false; | ||
| m_StopProcessingMessages = false; | ||
|
|
||
| ClearClients(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to answer your question, I'd like to ask a question here. wouldn't this change behavior such that connectedclients list(s) would be empty after stophost/client/server (aka shutdown) instead of (previously) containing stale data until we call Initialize() again?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok. done. |
||
| } | ||
|
|
||
| // INetworkUpdateSystem | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.