Merge pull request #15375 from volzhs/button-group

Remove button from button_group when free
This commit is contained in:
Rémi Verschelde 2018-01-05 23:20:19 +01:00 committed by GitHub
commit 8e8240450e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -539,15 +539,15 @@ BaseButton::BaseButton() {
set_focus_mode(FOCUS_ALL);
enabled_focus_mode = FOCUS_ALL;
action_mode = ACTION_MODE_BUTTON_RELEASE;
}
BaseButton::~BaseButton() {
if (button_group.is_valid()) {
button_group->buttons.erase(this);
}
}
BaseButton::~BaseButton() {
}
void ButtonGroup::get_buttons(List<BaseButton *> *r_buttons) {
for (Set<BaseButton *>::Element *E = buttons.front(); E; E = E->next()) {