1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Don't delete edit menu too early when closing script tabs

This commit is contained in:
Bernhard Liebl
2018-01-08 19:47:47 +01:00
parent 37ca542d2b
commit 7e1b39245f

View File

@@ -514,7 +514,6 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) {
if (p_save) { if (p_save) {
apply_scripts(); apply_scripts();
} }
current->clear_edit_menu();
notify_script_close(current->get_edited_script()); notify_script_close(current->get_edited_script());
} else { } else {
EditorHelp *help = Object::cast_to<EditorHelp>(tab_container->get_child(selected)); 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(); int idx = tab_container->get_current_tab();
if (current) {
current->clear_edit_menu();
}
memdelete(tselected); memdelete(tselected);
if (idx >= tab_container->get_child_count()) if (idx >= tab_container->get_child_count())
idx = tab_container->get_child_count() - 1; idx = tab_container->get_child_count() - 1;