From deb9f05303613ff7ab5ae440a4199e1d2806caff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 15 Jul 2024 21:28:58 +0200 Subject: [PATCH] st/theme-node-drawing: Fix corner pipeline leak The corner pipelines state theme node paint state was not necessarily free of existing pipelines, so make sure to free them before looking up new ones. This avoids leaking thousands of CoglPipeline instances after toggling the overview a bunch of times. Fixes: e1868cab1a ("st/theme-node-drawing: Factor in border radius in update_resources()") Part-of: --- src/st/st-theme-node-drawing.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c index 778ebd9bd..5933b3a3b 100644 --- a/src/st/st-theme-node-drawing.c +++ b/src/st/st-theme-node-drawing.c @@ -1374,6 +1374,7 @@ st_theme_node_maybe_prerender_background (StThemeNodePaintState *state, gboolean has_inset_box_shadow; gboolean has_large_corners; StShadow *box_shadow_spec; + StCorner corner_id; box_shadow_spec = st_theme_node_get_box_shadow (node); @@ -1416,6 +1417,9 @@ st_theme_node_maybe_prerender_background (StThemeNodePaintState *state, } } + for (corner_id = 0; corner_id < 4; corner_id++) + g_clear_object (&state->corner_pipeline[corner_id]); + state->corner_pipeline[ST_CORNER_TOPLEFT] = st_theme_node_lookup_corner (node, width, height, resource_scale, ST_CORNER_TOPLEFT); state->corner_pipeline[ST_CORNER_TOPRIGHT] =