Hi, I am unsure if my way of using the ComboBox to have a PopupMenu displaying CustomComponent. It seems like my CustomComponent won’t be deleted after I clear the PopupMenu. Here is the simplest example:
PopupMenu* lPopupMenu = mComboBox->getRootMenu();
PopupMenu::Item i;
i.itemID = mComboBox->getNumItems() + 1;
std::unique_ptr<MenuItemDeletableMetaData> lDeletable = std::make_unique<MenuItemDeletableMetaData>();
i.customComponent = lDeletable.release();
i.text = aName;
lPopupMenu->addItem(i);
// i clear it here for the example and expect the Menu item to be deleted
// but it is not.
lPopupMenu->clear();
Is there something I am doing wrong? I am with JUCE 5.4.7.