[mutter/gnome-3-38] wayland/subsurface: Check for parent actor before unparenting



commit 0db4ac7373965011a0fb2d3ff0465c227333d4c3
Author: Robert Mader <robert mader posteo de>
Date:   Fri Aug 6 13:12:26 2021 +0200

    wayland/subsurface: Check for parent actor before unparenting
    
    No need to assume the actor still has a parent. This silences warnings
    in normal builds and prevents a crash in fully optimized ones.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1958>

 src/wayland/meta-wayland-subsurface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index e876277a55..e8842a7602 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -291,7 +291,8 @@ unparent_actor (MetaWaylandSurface *surface)
     return;
 
   parent_actor = clutter_actor_get_parent (actor);
-  clutter_actor_remove_child (parent_actor, actor);
+  if (parent_actor)
+    clutter_actor_remove_child (parent_actor, actor);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]