Skip to content

Commit

Permalink
fix: NRE when destroying all objects (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lymdun committed Mar 20, 2020
1 parent 750c6ee commit 71e78a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Mirror/Runtime/NetworkClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ public void Shutdown()
if (LogFilter.Debug) Debug.Log("Shutting down client.");

ClearSpawners();
DestroyAllClientObjects();
spawnableObjects = null;
connection = null;
ready = false;
isSpawnFinished = false;
DestroyAllClientObjects();

connectState = ConnectState.None;
handlers.Clear();
Expand Down Expand Up @@ -762,7 +762,7 @@ public void ClearSpawners()
void UnSpawn(NetworkIdentity identity)
{
Guid assetId = identity.assetId;

identity.OnNetworkDestroy();
if (unspawnHandlers.TryGetValue(assetId, out UnSpawnDelegate handler) && handler != null)
{
Expand Down

0 comments on commit 71e78a7

Please sign in to comment.