Reopening plugin window in DAW resets the ComboBox selection

I’m unable to figure out what causes the ComboBox selection to reset to the first item every time I open my plugin window in DAW software?

For example I load my plugin in Ableton Live and tweak all the ComboBox selections and Sliders. Then I close the plugin window and reopen it again. Immediately the ComboBox selections reset to first selectable value. The Sliders stay as they should.

Any ideas what might cause this weird behaviour? The only place which touches the selection in the ComboBox is the lambda function set in the ComboBox.onChange.

Read your current value for your combo box in your constructor as well as whatever value listener you are using elsewhere.

Ah, it wasn’t obvious to me from documentation/tutorials that the UI actually gets destructed when you close it in the DAW. This explains everything. Thanks! :slight_smile:

That’s because it’s up to the DAW to decide that.
Some other DAW may decide to simply hide the UI of plug-ins without destroying them.
And some other may have a combined approach in which the UI is kept hidden if there are only few plug-ins, but are destroyed/recreated when several plug-ins are present to save on resources.
(I’m not aware of any DAW with a similar behavior, I’m just saying that the destroy/recreate behavior cannot be given for granted either)