Gtk2: Fixed fonts leaking memory.Patch by Luca Olivetti. Issues #18727, #18707

git-svn-id: trunk@33026 -
This commit is contained in:
zeljko 2011-10-22 18:12:47 +00:00
parent 188fb2d302
commit 7d2ebbe7a9

View File

@ -1534,6 +1534,9 @@ begin
begin
// add to cache
CachedFont := FontCache.Add(GdiObject^.GDIFontObject, LogFont, ALongFontName);
//decrement refcount for GdiObject^.GDIFontObject so that object gets
//released when removing from FontCache.
g_object_unref(GdiObject^.GDIFontObject);
if CachedFont <> nil then
begin
CachedFont.PangoFontDescription := PangoDesc;