setLookAndFeel (nullptr) triggers an assert failure in findColour ()

Thanks for the response, Jules.

I guess you meant “can’t you delete your GUI components before removing the L+F?”?

If that was the question, then the answer is - No. I don’t only need to remove a L+F at destruction of the editor/app, I also need to switch to another L+F during the lifetime of the editor to switch between themes.

I posted a representative simplification of my scenario, here

The issue pops out at destruction time of the editor, but also on every selectTheme () call, in which components would not be getting the custom L+F and instead would be redirected to the default one .

Keeping a pool of L+F objects is also not an option:

  • currently, the assert from the topic I linked, would be hit when I delete the first item in the pool during destruction of the editor.

I think my only option is to dynamically cast and check which L+F I am using in lookAndFeelChanged ().