Skip to content

revert: refactor RPQQueue singleton, shutdown queue flush #585

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 1 commit into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions com.unity.multiplayer.mlapi/Runtime/Core/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,17 @@ private void Init(bool server)
if (RpcQueueContainer != null)
{
UnityEngine.Debug.LogError("Init was invoked, but rpcQueueContainer was already initialized! (destroying previous instance)");
RpcQueueContainer.Dispose();
RpcQueueContainer.Shutdown();
RpcQueueContainer = null;
}

//The RpcQueueContainer must be initialized within the Init method ONLY
//It should ONLY be shutdown and destroyed in the Shutdown method (other than just above)
RpcQueueContainer = new RpcQueueContainer(this);
RpcQueueContainer = new RpcQueueContainer(false);

//Note: Since frame history is not being used, this is set to 0
//To test frame history, increase the number to (n) where n > 0
RpcQueueContainer.Initialize(0);

// Register INetworkUpdateSystem (always register this after rpcQueueContainer has been instantiated)
this.RegisterNetworkUpdate(NetworkUpdateStage.EarlyUpdate);
Expand Down Expand Up @@ -595,7 +599,7 @@ public void Shutdown()
//If an instance of the RpcQueueContainer is still around, then shut it down and remove the reference
if (RpcQueueContainer != null)
{
RpcQueueContainer.Dispose();
RpcQueueContainer.Shutdown();
RpcQueueContainer = null;
}

Expand Down
Loading