diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2024-03-24 20:09:07 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2024-03-24 21:26:18 +0300 |
commit | eab05558c412ad00b600db88a618128478b2f3ec (patch) | |
tree | 5464095ab6b52f996a53f9511a74312f837fb4ba /editor/editor_help.cpp | |
parent | fe01776f05b1787b28b4a270d53037a3c25f4ca2 (diff) | |
download | redot-engine-eab05558c412ad00b600db88a618128478b2f3ec.tar.gz |
Fix regression with C# build editor crash due to `EditorHelpHighlighter`
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r-- | editor/editor_help.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 022cf82426..bba1939f72 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -3471,7 +3471,9 @@ EditorHelpHighlighter::HighlightData EditorHelpHighlighter::_get_highlight_data( } text_edits[p_language]->set_text(p_source); - scripts[p_language]->set_source_code(p_source); + if (scripts[p_language].is_valid()) { // See GH-89610. + scripts[p_language]->set_source_code(p_source); + } highlighters[p_language]->_update_cache(); HighlightData result; @@ -3561,16 +3563,18 @@ EditorHelpHighlighter::EditorHelpHighlighter() { #ifdef MODULE_MONO_ENABLED TextEdit *csharp_text_edit = memnew(TextEdit); - Ref<CSharpScript> csharp; - csharp.instantiate(); + // See GH-89610. + //Ref<CSharpScript> csharp; + //csharp.instantiate(); Ref<EditorStandardSyntaxHighlighter> csharp_highlighter; csharp_highlighter.instantiate(); csharp_highlighter->set_text_edit(csharp_text_edit); - csharp_highlighter->_set_edited_resource(csharp); + //csharp_highlighter->_set_edited_resource(csharp); + csharp_highlighter->_set_script_language(CSharpLanguage::get_singleton()); text_edits[LANGUAGE_CSHARP] = csharp_text_edit; - scripts[LANGUAGE_CSHARP] = csharp; + //scripts[LANGUAGE_CSHARP] = csharp; highlighters[LANGUAGE_CSHARP] = csharp_highlighter; #endif } @@ -3578,14 +3582,10 @@ EditorHelpHighlighter::EditorHelpHighlighter() { EditorHelpHighlighter::~EditorHelpHighlighter() { #ifdef MODULE_GDSCRIPT_ENABLED memdelete(text_edits[LANGUAGE_GDSCRIPT]); - scripts[LANGUAGE_GDSCRIPT].unref(); - highlighters[LANGUAGE_GDSCRIPT].unref(); #endif #ifdef MODULE_MONO_ENABLED memdelete(text_edits[LANGUAGE_CSHARP]); - scripts[LANGUAGE_CSHARP].unref(); - highlighters[LANGUAGE_CSHARP].unref(); #endif } |