summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRindbee <idleman@yeah.net>2022-11-11 14:09:32 +0800
committerRindbee <idleman@yeah.net>2022-11-11 14:21:46 +0800
commit12787ad57d2be920de3011c1504ffaa18e469591 (patch)
tree4b73c8a947c01d7b21aa96d204bf2340c5fe79f4
parentd2bd8e5289d67d94ab9c087a6308eaebd4eea91a (diff)
Fix memory leak in `EditorSettingsDialog`
Delete `TreeItem`s that are not in `Tree`, `TreeItem` needs to be deleted manually.
-rw-r--r--editor/editor_settings_dialog.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp
index a72c545b2f..77a0d9f85c 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);
}
}
}