diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c index 677e9e88ce..11d410a205 100644 --- a/gsk/gl/gskglrenderjob.c +++ b/gsk/gl/gskglrenderjob.c @@ -803,6 +803,8 @@ gsk_gl_render_job_untransform_bounds (GskGLRenderJob *job, out_rect->origin.x -= job->offset_x; out_rect->origin.y -= job->offset_y; + + gsk_transform_unref (transform); } static inline void diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c index 3326a3086c..e2ccd3c336 100644 --- a/gsk/gskrendernodeimpl.c +++ b/gsk/gskrendernodeimpl.c @@ -5703,6 +5703,8 @@ gsk_mask_node_draw (GskRenderNode *node, cairo_clip (cr); cairo_mask (cr, mask_pattern); + + cairo_pattern_destroy (mask_pattern); } static void diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c index fc1e1cd422..ea54470c8c 100644 --- a/gsk/gskrendernodeparser.c +++ b/gsk/gskrendernodeparser.c @@ -2477,6 +2477,15 @@ printer_init (Printer *self, printer_init_duplicates_for_node (self, node); } +static void +printer_clear (Printer *self) +{ + if (self->str) + g_string_free (self->str, TRUE); + g_hash_table_unref (self->named_nodes); + g_hash_table_unref (self->named_textures); +} + #define IDENT_LEVEL 2 /* Spaces per level */ static void _indent (Printer *self) @@ -3686,6 +3695,7 @@ GBytes * gsk_render_node_serialize (GskRenderNode *node) { Printer p; + GBytes *res; printer_init (&p, node); @@ -3705,5 +3715,9 @@ gsk_render_node_serialize (GskRenderNode *node) render_node_print (&p, node); } - return g_string_free_to_bytes (p.str); + res = g_string_free_to_bytes (g_steal_pointer (&p.str)); + + printer_clear (&p); + + return res; } diff --git a/lsan.supp b/lsan.supp index 32185fc61a..1fd29993a1 100644 --- a/lsan.supp +++ b/lsan.supp @@ -8,3 +8,4 @@ leak:libgio-2.0.so leak:libcairo.so leak:libpixman-1.so leak:librsvg-2.so +leak:libxkbcommon.so diff --git a/testsuite/gsk/compare-render.c b/testsuite/gsk/compare-render.c index 9dcbe5ba8d..7ba25ad961 100644 --- a/testsuite/gsk/compare-render.c +++ b/testsuite/gsk/compare-render.c @@ -298,8 +298,12 @@ main (int argc, char **argv) { GskRenderNode *node2; GdkPixbuf *pixbuf, *pixbuf2; + GskTransform *transform; + + transform = gsk_transform_scale (NULL, -1, 1); + node2 = gsk_transform_node_new (node, transform); + gsk_transform_unref (transform); - node2 = gsk_transform_node_new (node, gsk_transform_scale (NULL, -1, 1)); save_node (node2, node_file, "-flipped.node"); rendered_texture = gsk_renderer_render_texture (renderer, node2, NULL); @@ -404,8 +408,12 @@ main (int argc, char **argv) { GskRenderNode *node2; GdkPixbuf *pixbuf, *pixbuf2; + GskTransform *transform; + + transform = gsk_transform_rotate (NULL, 90); + node2 = gsk_transform_node_new (node, transform); + gsk_transform_unref (transform); - node2 = gsk_transform_node_new (node, gsk_transform_rotate (NULL, 90)); save_node (node2, node_file, "-rotated.node"); rendered_texture = gsk_renderer_render_texture (renderer, node2, NULL);