mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -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;
|
||||
|
||||
opaque_region = meta_shaped_texture_get_opaque_region (priv->texture);
|
||||
|
||||
if (!opaque_region && meta_shaped_texture_is_opaque (priv->texture))
|
||||
if (opaque_region)
|
||||
{
|
||||
cairo_region_reference (opaque_region);
|
||||
}
|
||||
else if (meta_shaped_texture_is_opaque (priv->texture))
|
||||
{
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
@ -297,9 +300,10 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
|
||||
|
||||
opaque_region = cairo_region_create_rectangle (&rect);
|
||||
}
|
||||
|
||||
if (!opaque_region)
|
||||
return;
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
window_actor =
|
||||
meta_window_actor_from_actor (CLUTTER_ACTOR (surface_actor));
|
||||
@ -313,6 +317,7 @@ meta_surface_actor_cull_out (MetaCullable *cullable,
|
||||
if (clip_region)
|
||||
cairo_region_subtract (clip_region, scaled_opaque_region);
|
||||
|
||||
cairo_region_destroy (opaque_region);
|
||||
cairo_region_destroy (scaled_opaque_region);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user