From 92ce352cc2ce3ba2bf322338eab129f1cdf780de Mon Sep 17 00:00:00 2001 From: LeaoLuciano Date: Thu, 28 Oct 2021 07:51:48 -0300 Subject: [PATCH] Fix memory leak in RichTextLabel.remove_line (cherry picked from commit f21b5e4d2fb53e692988e01bf4f5b4957dd9422c) --- scene/gui/rich_text_label.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 2cc2483d63f..099d1404847 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1667,6 +1667,7 @@ void RichTextLabel::_remove_item(Item *p_item, const int p_line, const int p_sub _remove_item(p_item->subitems.front()->get(), p_line, p_subitem_line); } } + memdelete(p_item); } void RichTextLabel::add_image(const Ref &p_image, const int p_width, const int p_height) {