From a30d263522d1a33c26e6d77be05537c7cb5b620a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 27 Dec 2023 11:41:42 +0100 Subject: [PATCH] LibGfx: Don't clone fonts in FontCascadeList::extend() This was create a completely avoidable explosion of BitmapFont clones when running on SerenityOS. --- Userland/Libraries/LibGfx/FontCascadeList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/FontCascadeList.cpp b/Userland/Libraries/LibGfx/FontCascadeList.cpp index 1104492e10..b83f6364d6 100644 --- a/Userland/Libraries/LibGfx/FontCascadeList.cpp +++ b/Userland/Libraries/LibGfx/FontCascadeList.cpp @@ -21,7 +21,7 @@ void FontCascadeList::add(NonnullRefPtr font, Vector unicode void FontCascadeList::extend(FontCascadeList const& other) { for (auto const& font : other.m_fonts) { - m_fonts.append({ font.font->clone(), font.unicode_ranges }); + m_fonts.append({ font.font, font.unicode_ranges }); } }