[quartz] Fix CGFont leaks when creating quartz fonts

The toy font constructor and the _with_atsu_font_id constructor were
not properly managing the refcount of the CGFontRef.
This commit is contained in:
Vladimir Vukicevic 2008-04-27 15:20:43 -07:00 committed by Vladimir Vukicevic
parent 76e655e508
commit 122a31a075

View file

@ -343,6 +343,8 @@ _cairo_quartz_font_create_toy(cairo_toy_font_face_t *toy_face,
}
face = cairo_quartz_font_face_create_for_cgfont (cgFont);
CGFontRelease (cgFont);
if (face->status)
return face->status;
@ -780,8 +782,13 @@ cairo_quartz_font_face_create_for_atsu_font_id (ATSUFontID font_id)
{
ATSFontRef atsFont = FMGetATSFontRefFromFont (font_id);
CGFontRef cgFont = CGFontCreateWithPlatformFont (&atsFont);
cairo_font_face_t *ff;
return cairo_quartz_font_face_create_for_cgfont (cgFont);
ff = cairo_quartz_font_face_create_for_cgfont (cgFont);
CGFontRelease (cgFont);
return ff;
}
/* This is the old name for the above function, exported for compat purposes */