summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2017-09-17 13:19:38 +0000
committerPaulb23 <p_batty@hotmail.co.uk>2017-09-17 13:19:38 +0000
commita48dc9aa17308beb7395372751500925837841a5 (patch)
tree67fea051e2cf426a3147385c7eb27b9c5947af08 /editor/plugins
parent356af7d2a5f195867b41e2428ad7130c08472c2c (diff)
Fixed segfault on loading text editor theme
Diffstat (limited to 'editor/plugins')
-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();