UnityParticleSystemPreview
UnityParticleSystemPreview copied to clipboard
ParticleSystemPreview was not disposed properly.
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)
Solution:
In ParticleSystemGameObjectEditor, you need to add
private void OnDisable()
{
if (m_Preview != null)
m_Preview .Cleanup();
}