From 915f307a3e51b4dacea79e57b8db549d9a47230a Mon Sep 17 00:00:00 2001 From: James Frowen Date: Tue, 13 Feb 2024 23:05:13 +0000 Subject: [PATCH] fix: fixing unspawn handlers not being used in disconnect cleanup swapping order of clean up, so that object are destroyed with their handlers before those handlers are cleared --- Assets/Mirage/Runtime/ClientObjectManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Mirage/Runtime/ClientObjectManager.cs b/Assets/Mirage/Runtime/ClientObjectManager.cs index f459a4b413..9055898438 100644 --- a/Assets/Mirage/Runtime/ClientObjectManager.cs +++ b/Assets/Mirage/Runtime/ClientObjectManager.cs @@ -79,8 +79,8 @@ internal void ClientStarted(NetworkClient client) private void OnClientDisconnected(ClientStoppedReason reason) { - ClearSpawners(); DestroyAllClientObjects(); + ClearSpawners(); // reset for next run _client.Disconnected.RemoveListener(OnClientDisconnected);