Skip to content

Commit

Permalink
Dispose で Destory(this) する
Browse files Browse the repository at this point in the history
  • Loading branch information
ousttrue committed Jun 10, 2021
1 parent 04508d9 commit 5efbcef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Assets/UniGLTF/Runtime/UniGLTF/UnityObjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ public void EnableUpdateWhenOffscreen()
void OnDestroy()
{
Debug.Log("UnityResourceDestroyer.OnDestroy");
Dispose();
foreach (var (key, x) in m_resources)
{
UnityObjectDestoyer.DestroyRuntimeOrEditor(x);
}
}

public void TransferOwnership(TakeResponsibilityForDestroyObjectFunc take)
Expand All @@ -55,10 +58,7 @@ public void TransferOwnership(TakeResponsibilityForDestroyObjectFunc take)

public void Dispose()
{
foreach (var (key, x) in m_resources)
{
UnityObjectDestoyer.DestroyRuntimeOrEditor(x);
}
UnityObjectDestoyer.DestroyRuntimeOrEditor(this);
}
}
}

0 comments on commit 5efbcef

Please sign in to comment.