From 7e1b39245f96d425d5fb64cffef0c29e6c04deaa Mon Sep 17 00:00:00 2001 From: Bernhard Liebl Date: Mon, 8 Jan 2018 19:47:47 +0100 Subject: [PATCH] Don't delete edit menu too early when closing script tabs --- editor/plugins/script_editor_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index bc986cee9ca..51954a24d6a 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -514,7 +514,6 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) { if (p_save) { apply_scripts(); } - current->clear_edit_menu(); notify_script_close(current->get_edited_script()); } else { EditorHelp *help = Object::cast_to(tab_container->get_child(selected)); @@ -540,6 +539,9 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) { } int idx = tab_container->get_current_tab(); + if (current) { + current->clear_edit_menu(); + } memdelete(tselected); if (idx >= tab_container->get_child_count()) idx = tab_container->get_child_count() - 1;