Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
baf7e51484
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      src/juce_appframework/gui/components/controls/juce_ComboBox.cpp

+ 8
- 1
src/juce_appframework/gui/components/controls/juce_ComboBox.cpp View File

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


Loading…
Cancel
Save