Restoring state / unlock status AFTER program exit (FL, AudioPluginHost)

After unlocking and using my plugin, I can close/reopen and my settings will have stayed; it’s unlocked and my knobs are in the same place. However, when I save and close FL Studio or AudioPluginHost, I have to re-unlock and my knobs are reset.

Also, making a new instance of my plugin in the same FL session makes me re-unlock as well.

Am I missing something key here? I’m using JUCE’s docs on getStateInformation and setStateInformation.

If I understand the situation, you would have to save the fact that it is unlocked in a file and read that file when your plugin opens.

When you reload an instance of your plugin (by saving and closing), it should load the last thing saved in the plugin state. If something is not in the plugin state, it is lost. When you create a new instance of the plugin, a new state is created, so if something is not loaded into the new state by default, it won’t be there.