From 498a3e3d78efb1e9fe543206ca7391cdee45b21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 20 Jan 2019 10:06:17 +0100 Subject: [PATCH] particle/string: free glyphs and clusters in destroy() --- particles/string.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/particles/string.c b/particles/string.c index 4ffd119..2d8aede 100644 --- a/particles/string.c +++ b/particles/string.c @@ -31,7 +31,13 @@ static void exposable_destroy(struct exposable *exposable) { struct eprivate *e = exposable->private; + free(e->text); + if (e->glyphs != NULL) + cairo_glyph_free(e->glyphs); + if (e->clusters != NULL) + cairo_text_cluster_free(e->clusters); + free(e); exposable_default_destroy(exposable); } @@ -95,9 +101,6 @@ expose(const struct exposable *exposable, cairo_t *cr, int x, int y, int height) cairo_show_text_glyphs( cr, e->text, -1, e->glyphs, e->num_glyphs, e->clusters, e->num_clusters, e->cluster_flags); - - cairo_glyph_free(e->glyphs); - cairo_text_cluster_free(e->clusters); } static struct exposable *