I think this is a memory leak bug

#1
Here are some code of ColorLevelBlock
1580026018341.png

PhysicMaterial is unmanaged resource, and should be released with Object.Destroy(material) when the level block is removed. But I just cannot find this call.
Collider.material method creates an copy of the PhysicMaterial. You should use Collider.sharedMaterial instead. Also this.blockRenderer.material should be this.blockRenderer.sharedMaterial. Also this.blockRenderer.material should also be called with Object.Destroy().
 
Last edited:
Top