From fc77f983cb92e21f82e1f12c338e861dadcfa72f Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 6 Jun 2022 23:45:01 +0300 Subject: [RTL] Stop processing thread before deleting scroll bar. --- scene/gui/rich_text_label.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 0a35b8ecc8..cf7bf930a5 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1613,6 +1613,7 @@ void RichTextLabel::_notification(int p_what) { update(); } break; + case NOTIFICATION_PREDELETE: case NOTIFICATION_EXIT_TREE: { _stop_thread(); } break; @@ -2555,6 +2556,10 @@ bool RichTextLabel::_validate_line_caches() { void RichTextLabel::_process_line_caches() { // Shape invalid lines. + if (!is_inside_tree()) { + return; + } + MutexLock data_lock(data_mutex); Rect2 text_rect = _get_text_rect(); -- cgit v1.2.3