[mutter] wayland/subsurface: Check if actor exists before unparenting
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland/subsurface: Check if actor exists before unparenting
- Date: Mon, 7 Oct 2019 08:42:18 +0000 (UTC)
commit 66ae09b670602347e34ae39eba2f5410ccb28007
Author: Robert Mader <robert mader posteo de>
Date: Sun Oct 6 12:11:19 2019 +0200
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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]