diff options
author | Rindbee <idleman@yeah.net> | 2022-07-19 19:09:10 +0800 |
---|---|---|
committer | Rindbee <idleman@yeah.net> | 2022-07-19 19:09:27 +0800 |
commit | 8972dd8492a743e44e3e9d9143397d1f08c440ff (patch) | |
tree | ba89320fc2072e84a2947d22cbf391fcff64c2b9 /editor | |
parent | abe8b88702cdb4ce5ce154c31cb989e1cee56b5e (diff) |
Fix incorrectly clearing edit menu
Delete only if `editor_enabled` is true, otherwise destructor may delete it repeatedly.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 66cd85a26a..b9cc08fee5 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1420,7 +1420,9 @@ Control *ScriptTextEditor::get_edit_menu() { } void ScriptTextEditor::clear_edit_menu() { - memdelete(edit_hb); + if (editor_enabled) { + memdelete(edit_hb); + } } void ScriptTextEditor::set_find_replace_bar(FindReplaceBar *p_bar) { |