summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-09-17 17:57:00 +0200
committerGitHub <noreply@github.com>2017-09-17 17:57:00 +0200
commit4208518c4de88186a8baac5d87e4c20c218fccc8 (patch)
tree3a1ddfad8ff6c84200a3fec0f36c006771b88795
parent3531251902595f4d2d17cab7100b4ff7a1eee2c7 (diff)
parenta48dc9aa17308beb7395372751500925837841a5 (diff)
Merge pull request #11356 from Paulb23/text_editor_theme_crash
Fixed segfault on loading text editor theme [ci skip]
-rw-r--r--editor/plugins/script_editor_plugin.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 44a9bc6d2e..9af5885a17 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1682,9 +1682,10 @@ bool ScriptEditor::edit(const Ref<Script> &p_script, int p_line, int p_col, bool
break;
}
ERR_FAIL_COND_V(!se, false);
- tab_container->add_child(se);
+ // load script before adding as child else editor will crash at theme loading
se->set_edited_script(p_script);
+ tab_container->add_child(se);
se->set_tooltip_request_func("_get_debug_tooltip", this);
if (se->get_edit_menu()) {
se->get_edit_menu()->hide();