From 20bdd203aa82c3a20dbc4ffe4c5d93474a784fd3 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 21 Feb 2011 18:20:59 +0800 Subject: [PATCH] gdi32: Go through all hfontlist entries not just the first one when checking whether font is in the child font list. --- dlls/gdi32/freetype.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index e0a93f8823f..edddde1a1fc 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3908,14 +3908,16 @@ BOOL WineEngDestroyFontInstance(HFONT handle) LIST_FOR_EACH_ENTRY(gdiFont, &child_font_list, struct tagGdiFont, entry) { - struct list *first_hfont = list_head(&gdiFont->hfontlist); - hflist = LIST_ENTRY(first_hfont, HFONTLIST, entry); - if(hflist->hfont == handle) - { - TRACE("removing child font %p from child list\n", gdiFont); - list_remove(&gdiFont->entry); - LeaveCriticalSection( &freetype_cs ); - return TRUE; + hfontlist_elem_ptr = list_head(&gdiFont->hfontlist); + while(hfontlist_elem_ptr) { + hflist = LIST_ENTRY(hfontlist_elem_ptr, struct tagHFONTLIST, entry); + hfontlist_elem_ptr = list_next(&gdiFont->hfontlist, hfontlist_elem_ptr); + if(hflist->hfont == handle) { + TRACE("removing child font %p from child list\n", gdiFont); + list_remove(&gdiFont->entry); + LeaveCriticalSection( &freetype_cs ); + return TRUE; + } } }