Bug in ComboBox destructor when showing pop-up!


#1

Create a component containing a combobox.

When running, activate the combo box list pop-up “menu”, and close the container component.

Raises this assertion…!

ComboBox::~ComboBox()
{
    jassert (! menuActive); // deleting the combo box while it's in use? Probably not a great idea.

Looks like the ComboBox implementation might require a bit more in its tidy-up code?

HTH!

Pete


#2

ok, try the version I’ve just checked in.

It’s a bit of a messy situation because the combobox is being deleted whilst it’s still in a modal loop higher up the stack, but I’ve added a deletion check to bail out if that happens.


#3

Cheers Jules! :slight_smile:


#4

BTW, might this happen hypothetically for a pop-up menu in a TextEdit component…?


#5

Well it could happen hypothetically for any combobox, because even in a modal loop there’s nothing stopping them being deleted by a timer or event callback. I think the fix I did is pretty safe though.


#6