Browse Source

LibGfx: Don't clone fonts in FontCascadeList::extend()

This was create a completely avoidable explosion of BitmapFont clones
when running on SerenityOS.
Andreas Kling 1 year ago
parent
commit
a30d263522
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Libraries/LibGfx/FontCascadeList.cpp

+ 1 - 1
Userland/Libraries/LibGfx/FontCascadeList.cpp

@@ -21,7 +21,7 @@ void FontCascadeList::add(NonnullRefPtr<Font> font, Vector<UnicodeRange> 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 });
     }
 }