I don’t know if this is a bug, or something I’m doing wrong (likely the latter). But I am putting up PopupMenu from a TextButton using a lambda, like this:
addAndMakeVisible(menuButton);
menuButton.onClick = [this] {
PopupMenu menu;
menu.addItem(1, "item 1");
menu.addItem(2, "item 2");
int sel = menu.show();
if (sel)
{
//do stuff
}
If I quite the app with the popup open, quite often I get this:
*** Leaked objects detected: 3 instance(s) of class MouseInputSource
JUCE Assertion failure in juce_LeakedObjectDetector.h:90
This is on Mac OSX Mojave in a gui app. I would assume JUCE is supposed to handle this, but maybe not. Any ideas? Thanks.
I guess, it’s because the menu.show() created a modal loop, that didn’t finish when the app closes down.
Maybe calling the static PopupMenu::dismissAllActiveMenus() in the quit command helps.
I have a hunch that this is already been called though, but has no chance to finish, since it is only next in the message queue.