1
0
Fork 0

surface-actor: Fix leak when setting non-empty clip region

When 655b4a9c75 ported this to MtkRegion, it removed the unref of the
copied region after setting it in the shaped texture.

Fixes: 655b4a9c7 ("Port to MtkRegion")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3140
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3365>
This commit is contained in:
Sebastian Keller 2023-11-06 20:19:53 +01:00
parent a772c709aa
commit 145cac3a37

View file

@ -157,11 +157,17 @@ set_clip_region (MetaSurfaceActor *surface_actor,
MetaShapedTexture *stex = priv->texture;
if (clip_region && !mtk_region_is_empty (clip_region))
meta_shaped_texture_set_clip_region (stex,
mtk_region_copy (clip_region));
{
g_autoptr (MtkRegion) clip_region_copy = NULL;
clip_region_copy = mtk_region_copy (clip_region);
meta_shaped_texture_set_clip_region (stex, clip_region_copy);
}
else
{
meta_shaped_texture_set_clip_region (stex, clip_region);
}
}
static void
meta_surface_actor_pick (ClutterActor *actor,