Browse Source

Merge pull request #61763 from bruvzg/rtl_predelete

Rémi Verschelde 3 năm trước cách đây
mục cha
commit
8fb004efbc
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      scene/gui/rich_text_label.cpp

+ 5 - 0
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();