| @@ -64,7 +64,9 @@ ComboBox::ComboBox (const String& name) | |||||
| ComboBox::~ComboBox() | ComboBox::~ComboBox() | ||||
| { | { | ||||
| jassert (! menuActive); // deleting the combo box while it's in use? Probably not a great idea. | |||||
| if (menuActive) | |||||
| PopupMenu::dismissAllActiveMenus(); | |||||
| deleteAllChildren(); | deleteAllChildren(); | ||||
| } | } | ||||
| @@ -517,6 +519,7 @@ void ComboBox::showPopup() | |||||
| if (! menuActive) | if (! menuActive) | ||||
| { | { | ||||
| const int currentId = getSelectedId(); | const int currentId = getSelectedId(); | ||||
| ComponentDeletionWatcher deletionWatcher (this); | |||||
| PopupMenu menu; | PopupMenu menu; | ||||
| @@ -542,6 +545,10 @@ void ComboBox::showPopup() | |||||
| menuActive = true; | menuActive = true; | ||||
| const int resultId = menu.showAt (this, currentId, | const int resultId = menu.showAt (this, currentId, | ||||
| getWidth(), 1, itemHeight); | getWidth(), 1, itemHeight); | ||||
| if (deletionWatcher.hasBeenDeleted()) | |||||
| return; | |||||
| menuActive = false; | menuActive = false; | ||||
| if (resultId != 0) | if (resultId != 0) | ||||