瀏覽代碼

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 年之前
父節點
當前提交
a30d263522
共有 1 個文件被更改,包括 1 次插入1 次删除
  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 });
     }
 }