We have a plugin that has a combobox (NOT using any parameter attachment), for which we set its index to 0 at the end of the constructor. If the user opens the editor and then immediately closes it, it crashes.
This appears to be because the setting of that index triggers an asynchronous update, which is processed after the view component’s destructor has been called, causing the component’s onComboBoxChanged() function to be called, with an invalid object for the combobox. It’s a reference-counted object (std::unique_ptr), so I can’t simply check for nullptr, and the reference count shown in the debugger is garbage, so that’s no help, either.
How can I prevent this crash (other than telling users “Don’t close the editor that soon after opening it!”)?