summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-01-08 20:08:04 +0100
committerGitHub <noreply@github.com>2018-01-08 20:08:04 +0100
commit15cb56122e3275b1b0f5018e03350ec1c2573d4a (patch)
tree57d4a45d0bd965b6c79d1483d67ce66fce310541
parent299e490cf4c9cfd72a9e4f53effaa41bf5e0d7df (diff)
parent7e1b39245f96d425d5fb64cffef0c29e6c04deaa (diff)
Merge pull request #15498 from poke1024/fix15478
Don't delete edit menu too early when closing script tabs
-rw-r--r--editor/plugins/script_editor_plugin.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index bc986cee9c..51954a24d6 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<EditorHelp>(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;