diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-04-12 11:39:05 +0300 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-04-24 17:03:55 +0200 |
commit | 9c1ea280927a1376cd31e1b0dfe7ca5abd12e693 (patch) | |
tree | 7d2a57f114ab3c176f3feb30464995aadd7445c7 /editor | |
parent | 3a1af9393f0accfed8d05a257e2ff8af6b2e7050 (diff) |
Improve line BiDi handling, prevent crash on recursive log updates.
(cherry picked from commit 282e4231c26c172b186a5bf22a8ba7f0337ba3d6)
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_log.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 4ee28c5c31..cc88424c55 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -278,6 +278,11 @@ void EditorLog::_add_log_line(LogMessage &p_message, bool p_replace_previous) { return; } + if (unlikely(log->is_updating())) { + // The new message arrived during log RTL text processing/redraw (invalid BiDi control characters / font error), ignore it to avoid RTL data corruption. + return; + } + // Only add the message to the log if it passes the filters. bool filter_active = type_filter_map[p_message.type]->is_active(); String search_text = search_box->get_text(); |