Changes in UnityEditor.Editor

Hello, we used to have our ReleaseManagement in a SO and for that we had a Custom Editor. All worked fine till we switched to Unity-2022-3-LTS from Unity-2021-3-LTS recently.

After looking at what broke, it seems that our foldouts were getting destroyed every time we would extend or collapse the foldouts.

protected bool[] foldouts;

We could observe that by adding a breakpoint in OnInspectorGUI where the foldout array was created:

if (foldouts==null)
{
    foldouts = new bool[releasesProperty.arraySize];
}

A fast fix would be to make this static as we only have one release management Scriptable Object but that’s more of a hack than a solution. How should we persist this array in Unity-2022-3-LTS without it getting GCed ?

…Or is this a bug and maybe i should file a bug report?.. Let’s assume i don’t know what i’m doing first :smiley: