summaryrefslogtreecommitdiff
path: root/src/cairo-font-options.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-01-05 09:09:01 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-01-05 09:09:01 -0500
commit1f0b6707eab54ddbcc9ac0b68e0e483d33704644 (patch)
treec5d135d40e97b7ca8e8e2442fbcd6882f07e77da /src/cairo-font-options.c
parent17871c52eff5ae89af08b9deb4be36b6b6f4c0e3 (diff)
downloadcairo-1f0b6707eab54ddbcc9ac0b68e0e483d33704644.tar.gz
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.
Diffstat (limited to 'src/cairo-font-options.c')
-rw-r--r--src/cairo-font-options.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cairo-font-options.c b/src/cairo-font-options.c
index ea703423b..de6ae951f 100644
--- a/src/cairo-font-options.c
+++ b/src/cairo-font-options.c
@@ -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);
}