diff options
Diffstat (limited to 'src/gui/guiKeyChangeMenu.cpp')
-rw-r--r-- | src/gui/guiKeyChangeMenu.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/gui/guiKeyChangeMenu.cpp b/src/gui/guiKeyChangeMenu.cpp index ada6280f6..021f5f0a9 100644 --- a/src/gui/guiKeyChangeMenu.cpp +++ b/src/gui/guiKeyChangeMenu.cpp @@ -93,7 +93,8 @@ GUIKeyChangeMenu::GUIKeyChangeMenu(gui::IGUIEnvironment* env, GUIKeyChangeMenu::~GUIKeyChangeMenu() { - removeChildren(); + removeAllChildren(); + key_used_text = nullptr; for (key_setting *ks : key_settings) { delete[] ks->button_name; @@ -102,23 +103,10 @@ GUIKeyChangeMenu::~GUIKeyChangeMenu() key_settings.clear(); } -void GUIKeyChangeMenu::removeChildren() -{ - const core::list<gui::IGUIElement*> &children = getChildren(); - core::list<gui::IGUIElement*> children_copy; - for (gui::IGUIElement*i : children) { - children_copy.push_back(i); - } - - for (gui::IGUIElement *i : children_copy) { - i->remove(); - } - key_used_text = nullptr; -} - void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { - removeChildren(); + removeAllChildren(); + key_used_text = nullptr; const float s = m_gui_scale; DesiredRect = core::rect<s32>( |