UnityParticleSystemPreview icon indicating copy to clipboard operation
UnityParticleSystemPreview copied to clipboard

ParticleSystemPreview was not disposed properly.

Open larssteenhoff opened this issue 4 years ago • 1 comments

After switching to another particle there is this error: Using unity 2022

ParticleSystemPreview was not disposed properly. Make sure that base.Cleanup is called if overriding the Cleanup method. If you are implementing this in an Editor or EditorWindow, don't forget to call ObjectPreview.Cleanup in OnDisable. UnityEditor.ObjectPreview:Finalize () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:58)

larssteenhoff avatar Jan 02 '22 00:01 larssteenhoff

Solution:

In ParticleSystemGameObjectEditor, you need to add

private void OnDisable()
{
  if (m_Preview != null)
     m_Preview .Cleanup();
}

larssteenhoff avatar Jan 02 '22 18:01 larssteenhoff