Possible bug in UIBehaviour::showInfoMessage

Hi,
not sure where the best place for this is (here or github?). I think there is a small bug in the UIBehaviour::showInfoMessage method. The BubbleMessageComponent used here:

void UIBehaviour::showInfoMessage (const String& message)
{
    if (auto c = Desktop::getInstance().getMainMouseSource().getComponentUnderMouse())
    {
        auto bmc = new BubbleMessageComponent();
        bmc->addToDesktop (0);
        bmc->showAt (c, AttributedString (message), 2000);
    }
}

is not deleted and thus throws this exception: jassert (desktopComponents.size() == 0);

As the component is not reused, I’d propose just setting the deleteSelfAfterUse flag to true in the showAt method:

void UIBehaviour::showInfoMessage (const String& message)
{
    if (auto c = Desktop::getInstance().getMainMouseSource().getComponentUnderMouse())
    {
        auto bmc = new BubbleMessageComponent();
        bmc->addToDesktop (0);
        bmc->showAt (c, AttributedString (message), 2000, true, true);
    }
}

Cheers

Thanks for the report. I’ve just fixed it on develop, should appear on GitHub in an hour or so.

Great, thanks.