mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-03 06:38:06 +02:00
[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:
parent
76e655e508
commit
122a31a075
1 changed files with 8 additions and 1 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue