- Home /
Destruction procedural mesh in the editor
I currently create procedural mesh in the editor like that:
meshFilter.mesh = Create()
If I call that multiple time and save. I have this error:
Cleaning up leaked objects in scene since no game object, component or manager is referencing them Mesh ProceduralPlane has been leaked X times
If I try to destroy it, I have this error:
Instantiating mesh due to calling MeshFilter.mesh during edit mode. This will leak meshes. Please use MeshFilter.sharedMesh instead.
And I can't use sharedMesh since all my meshes on my objects are unique and I don't want them to be instantied when I duplicate them
So my question is what is the good way to destroy mesh without leak in the editor?
Your answer
![](https://koobas.hobune.stream/wayback/20220613132556im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Is there any way to reset the default meshes? 3 Answers
Mesh memory leak error 0 Answers
Memory Leak Adventures in Editor (3.4, lot of instantiated objects) 1 Answer
Query if MeshFilter is instantiated or shared? 1 Answer
Editor Script Handles.Label problem. Labels don't move with gameobject 1 Answer