Просмотр исходного кода

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 год назад
Родитель
Сommit
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 });
     }
 }