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

This commit is contained in:
Dmitry Timoshkov 2011-02-21 18:21:46 +08:00 committed by Alexandre Julliard
parent 20bdd203aa
commit e0f5ddddf1
1 changed files with 8 additions and 8 deletions

View File

@ -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);