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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3421>
This commit is contained in:
Jonas Ådahl 2024-07-15 21:28:58 +02:00 committed by Robert Mader
parent 35647a0b65
commit deb9f05303

View File

@ -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] =