WebCore::SimpleFontData::smallCapsFontData() is allocating a FontPlatformData object on the heap and assigns it to a const pointer and never frees it. The FontPlatformData is used for assigning the member of the same type in a SimpleFontData object. Usually, ports implement the data of FontPlatformData to be reference counted, and the instance in SimpleFontData takes over the ownership (same in the Gtk port). The Haiku port contained the same problem initially, that's why I spotted it when cross referencing the Gtk port.
Created attachment 53243 [details] Patch to fix the problem
Comment on attachment 53243 [details] Patch to fix the problem > Index: WebCore/ChangeLog > =================================================================== > --- WebCore/ChangeLog (revision 57513) > +++ WebCore/ChangeLog (working copy) > @@ -1,3 +1,18 @@ > +2010-04-13 Stephan AÃmus <superstippi@gmx.de> > + > + Reviewed by NOBODY (OOPS!). > + > + [Gtk] Fix leaking the FontPlatformData instance used to create the the > + small caps font data. > + https://bugs.webkit.org/show_bug.cgi?id=37500 > + > + No new tests needed. > + > + * platform/graphics/gtk/SimpleFontDataPango.cpp: > + (WebCore::SimpleFontData::smallCapsFontData): > + - Use a stack allocated FontPlatformData instead of a heap allocated > + one that is never freed. Thanks a lot!
git grep "const FontPlatformData\* pdata = new" WebCore/platform/graphics/ WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp: const FontPlatfo WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp: const FontPlatform WebCore/platform/graphics/wx/SimpleFontDataWx.cpp: so, we need to fix these two as well.
Comment on attachment 53243 [details] Patch to fix the problem Clearing flags on attachment: 53243 Committed r58679: <http://trac.webkit.org/changeset/58679>
All reviewed patches have been landed. Closing bug.