diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-08-02 21:37:13 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-08-02 21:37:13 +0200 |
commit | 79f6ac5cd5809e559477c97e89a2f7efb8d82ab2 (patch) | |
tree | 938546f667ed3bb230b60e8515c71b530aa3f114 | |
parent | f415200323d0684942184818ab0fecdb994b54d8 (diff) | |
parent | b3a5e10f4a72732d3bc1e6bf075d507c1a8159a4 (diff) | |
download | redot-engine-79f6ac5cd5809e559477c97e89a2f7efb8d82ab2.tar.gz |
Merge pull request #80161 from RandomShaper/avoid_crash_on_late_prints
Avoid crash on exiting due to late prints
-rw-r--r-- | editor/editor_node.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 2fa02ae1d4..e0a014ac1a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6730,6 +6730,9 @@ void EditorNode::_print_handler(void *p_this, const String &p_string, bool p_err } void EditorNode::_print_handler_impl(const String &p_string, bool p_error, bool p_rich) { + if (!singleton) { + return; + } if (p_error) { singleton->log->add_message(p_string, EditorLog::MSG_TYPE_ERROR); } else if (p_rich) { @@ -6845,6 +6848,7 @@ EditorNode::EditorNode() { DisplayServer::get_singleton()->cursor_set_custom_image(Ref<Resource>()); } + DEV_ASSERT(!singleton); singleton = this; EditorUndoRedoManager::get_singleton()->connect("version_changed", callable_mp(this, &EditorNode::_update_undo_redo_allowed)); @@ -8210,6 +8214,8 @@ EditorNode::~EditorNode() { GDExtensionEditorPlugins::editor_node_add_plugin = nullptr; GDExtensionEditorPlugins::editor_node_remove_plugin = nullptr; + + singleton = nullptr; } /* |