Commit e0f5dddd authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdi32: Do not leak the hfont list (Valgrind).

parent 20bdd203
......@@ -3086,20 +3086,20 @@ static void free_font(GdiFont *font)
LIST_FOR_EACH_SAFE(cursor, cursor2, &font->child_fonts)
{
CHILD_FONT *child = LIST_ENTRY(cursor, CHILD_FONT, entry);
struct list *first_hfont;
HFONTLIST *hfontlist;
list_remove(cursor);
if(child->font)
{
first_hfont = list_head(&child->font->hfontlist);
hfontlist = LIST_ENTRY(first_hfont, HFONTLIST, entry);
DeleteObject(hfontlist->hfont);
HeapFree(GetProcessHeap(), 0, hfontlist);
free_font(child->font);
}
HeapFree(GetProcessHeap(), 0, child);
}
LIST_FOR_EACH_SAFE(cursor, cursor2, &font->hfontlist)
{
HFONTLIST *hfontlist = LIST_ENTRY(cursor, HFONTLIST, entry);
DeleteObject(hfontlist->hfont);
list_remove(&hfontlist->entry);
HeapFree(GetProcessHeap(), 0, hfontlist);
}
if (font->ft_face) pFT_Done_Face(font->ft_face);
if (font->mapping) unmap_font_file( font->mapping );
HeapFree(GetProcessHeap(), 0, font->kern_pairs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment