My slider's popup causing assert failure on plugin close

I have some sliders in my plugin editor UI with setPopupMenuEnabled(true). I’ve noticed that if I open a popup menu, by right clicking on the slider, and close the plugin’s window (before clearing the menu) I get an assertion failure in, line 1086

I kinda understand the reason for this but mostly looking for a solution to avoid it happening. Could anyone suggest one please ?

See this thread:


Thanks for the suggestion but I am not sure how should I use it in this case.
I think that the dismiss should go into the editor’s destructor, but the assert failure happens before the destructor gets called.
It seams that in the case of the Widgets demo something happens differently because by the time I close the window the popup is gone.
Here on the other hand the floating popup gets destroyed only after destroying the editor’s UI.

I was implying you probably need to add

somewhere before the editor’s UI is destroyed.


Yep, just that I don’t know where should that be. Like is there some method called before the UI is destroyed ? I was thinking of userTriedToCloseWindow but that’s for different scenario…

Also it’s quite weird that if I comment out the line you’ve mentioned in the demo, the popup still gets destroyed at close :roll: