Add a _cairo_font_options_fini function

The variations member of cairo_font_options_t is allocated,
so we need to have a method to free it for cases where
the struct is embedded in larger structs, such as cairo_ft_options_t.
This commit is contained in:
Matthias Clasen 2018-01-05 09:09:01 -05:00
parent 17871c52ef
commit 1f0b6707ea
2 changed files with 10 additions and 1 deletions

View file

@ -154,6 +154,12 @@ cairo_font_options_copy (const cairo_font_options_t *original)
return options;
}
void
_cairo_font_options_fini (cairo_font_options_t *options)
{
free (options->variations);
}
/**
* cairo_font_options_destroy:
* @options: a #cairo_font_options_t
@ -169,7 +175,7 @@ cairo_font_options_destroy (cairo_font_options_t *options)
if (cairo_font_options_status (options))
return;
free (options->variations);
_cairo_font_options_fini (options);
free (options);
}

View file

@ -880,6 +880,9 @@ cairo_private void
_cairo_font_options_init_copy (cairo_font_options_t *options,
const cairo_font_options_t *other);
cairo_private void
_cairo_font_options_fini (cairo_font_options_t *options);
cairo_private void
_cairo_font_options_set_lcd_filter (cairo_font_options_t *options,
cairo_lcd_filter_t lcd_filter);