From 12787ad57d2be920de3011c1504ffaa18e469591 Mon Sep 17 00:00:00 2001 From: Rindbee Date: Fri, 11 Nov 2022 14:09:32 +0800 Subject: [PATCH] Fix memory leak in `EditorSettingsDialog` Delete `TreeItem`s that are not in `Tree`, `TreeItem` needs to be deleted manually. --- editor/editor_settings_dialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index a72c545b2f2..77a0d9f85c9 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -487,6 +487,7 @@ void EditorSettingsDialog::_update_shortcuts() { TreeItem *section = E.value; if (section->get_first_child() == nullptr) { root->remove_child(section); + memdelete(section); } } }