How to release Mesh component created realtime?

I use new Mesh () to create many of the Mesh object, and then attached to the Mesh Filter
If Destroy this GameObject directly,

Through FindObjectsByType ,I found, Mesh object is not released.

So I try to set Mesh Prop of Mesh Filter to null, then Destroy GameObject.
But the same result .

how to solve it? thx!

1 Answer

1

Use Destroy on the mesh you created.

thx!Yes,I can see mesh property turn to missing in the Inspector. but,why I execute the FindObjectsOfType() function ,the number of the Mesh object unchanged... something wrong?