mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 19:10:43 -05:00
surface-actor: Fix memory leak
When we create a new region for an opaque texture we need to free it. While on it, simplify the check slightly. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1108
This commit is contained in:
parent
c131a9b7fa
commit
1d20045247
@ -285,8 +285,11 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
|
|||||||
int geometry_scale = 1;
|
int geometry_scale = 1;
|
||||||
|
|
||||||
opaque_region = meta_shaped_texture_get_opaque_region (priv->texture);
|
opaque_region = meta_shaped_texture_get_opaque_region (priv->texture);
|
||||||
|
if (opaque_region)
|
||||||
if (!opaque_region && meta_shaped_texture_is_opaque (priv->texture))
|
{
|
||||||
|
cairo_region_reference (opaque_region);
|
||||||
|
}
|
||||||
|
else if (meta_shaped_texture_is_opaque (priv->texture))
|
||||||
{
|
{
|
||||||
cairo_rectangle_int_t rect;
|
cairo_rectangle_int_t rect;
|
||||||
|
|
||||||
@ -297,9 +300,10 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
|
|||||||
|
|
||||||
opaque_region = cairo_region_create_rectangle (&rect);
|
opaque_region = cairo_region_create_rectangle (&rect);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (!opaque_region)
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
window_actor =
|
window_actor =
|
||||||
meta_window_actor_from_actor (CLUTTER_ACTOR (surface_actor));
|
meta_window_actor_from_actor (CLUTTER_ACTOR (surface_actor));
|
||||||
@ -313,6 +317,7 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
|
|||||||
if (clip_region)
|
if (clip_region)
|
||||||
cairo_region_subtract (clip_region, scaled_opaque_region);
|
cairo_region_subtract (clip_region, scaled_opaque_region);
|
||||||
|
|
||||||
|
cairo_region_destroy (opaque_region);
|
||||||
cairo_region_destroy (scaled_opaque_region);
|
cairo_region_destroy (scaled_opaque_region);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user