Fix a memory leak, fix a typo in the comment, add a trace

Dmitry Timoshkov dmitry at codeweavers.com
Mon Sep 18 21:44:52 CDT 2006


Hello,

please apply after "Implement GetKerningPairs for TrueType fonts".

Changelog:
    - fix a memory leak
    - fix a typo in the comment
    - add a trace about skipped a not supported kerning table format

--- cvs/hq/wine/dlls/gdi/freetype.c	2006-09-19 11:31:50.000000000 +0900
+++ wine/dlls/gdi/freetype.c	2006-09-19 11:34:58.000000000 +0900
@@ -1966,6 +1966,7 @@ static void free_font(GdiFont font)
     }
 
     if (font->ft_face) pFT_Done_Face(font->ft_face);
+    HeapFree(GetProcessHeap(), 0, font->kern_pairs);
     HeapFree(GetProcessHeap(), 0, font->potm);
     HeapFree(GetProcessHeap(), 0, font->name);
     HeapFree(GetProcessHeap(), 0, font->gm);
@@ -4296,7 +4297,7 @@ DWORD WineEngGetKerningPairs(GdiFont fon
                tt_kern_subtable->version, tt_kern_subtable->length,
                tt_kern_subtable->coverage.word, tt_kern_subtable->coverage.bits.format);
 
-        /* Accordibg to the TrueType specification this is the only format
+        /* According to the TrueType specification this is the only format
          * that will be properly interpreted by Windows and OS/2
          */
         if (tt_kern_subtable->coverage.bits.format == 0)
@@ -4317,6 +4318,8 @@ DWORD WineEngGetKerningPairs(GdiFont fon
             parse_format0_kern_subtable(font, (struct TT_format0_kern_subtable *)(tt_kern_subtable + 1),
                         glyph_to_char, font->kern_pairs + old_total, new_chunk);
         }
+        else
+            TRACE("skipping kerning table format %u\n", tt_kern_subtable->coverage.bits.format);
 
         tt_kern_subtable = (struct TT_kern_subtable *)((char *)tt_kern_subtable + tt_kern_subtable->length);
     }





More information about the wine-patches mailing list