wayland/subsurface: Check if actor exists before unparenting

When we call the subsurface destructor the actor might be gone already.
Check first, like we do in other places, to avoid warnings.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/829
This commit is contained in:
Robert Mader 2019-10-06 12:11:19 +02:00 committed by Jonas Ådahl
parent 7b97c7b35e
commit 66ae09b670

View File

@ -304,9 +304,13 @@ meta_wayland_subsurface_class_init (MetaWaylandSubsurfaceClass *klass)
static void
unparent_actor (MetaWaylandSurface *surface)
{
ClutterActor *actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
ClutterActor *actor;
ClutterActor *parent_actor;
actor = CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
if (!actor)
return;
parent_actor = clutter_actor_get_parent (actor);
clutter_actor_remove_child (parent_actor, actor);
}