compositor: Fix surface accounting at MetaWindowActor
When the actor gets a new "main" surface assigned, it adds the
new surface to the stack of surface actors, but forgets to remove
the old one.
This stale pointer in the array may cause invalid reads and crashes
after the assigned surface is disposed, e.g. when destroying the
MetaWindowActor tries to disconnect signals from all accounted
surface actors.
Fixes: 9a2c8b2592
("window: Add suspend state")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3252>
This commit is contained in:
parent
33eef7211a
commit
80e15775a5
1 changed files with 3 additions and 0 deletions
|
@ -367,6 +367,9 @@ meta_window_actor_real_assign_surface_actor (MetaWindowActor *self,
|
||||||
MetaWindowActorPrivate *priv =
|
MetaWindowActorPrivate *priv =
|
||||||
meta_window_actor_get_instance_private (self);
|
meta_window_actor_get_instance_private (self);
|
||||||
|
|
||||||
|
if (priv->surface)
|
||||||
|
meta_window_actor_remove_surface_actor (self, priv->surface);
|
||||||
|
|
||||||
g_clear_object (&priv->surface);
|
g_clear_object (&priv->surface);
|
||||||
priv->surface = g_object_ref_sink (surface_actor);
|
priv->surface = g_object_ref_sink (surface_actor);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue