From 66ae09b670602347e34ae39eba2f5410ccb28007 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Sun, 6 Oct 2019 12:11:19 +0200 Subject: [PATCH] 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 --- src/wayland/meta-wayland-subsurface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c index 6d181150c..6abfde19f 100644 --- a/src/wayland/meta-wayland-subsurface.c +++ b/src/wayland/meta-wayland-subsurface.c @@ -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); }