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>
This commit is contained in:
Robert Mader 2021-08-06 13:12:26 +02:00 committed by Marge Bot
parent d17e9adc73
commit 2a2f9300d0

View File

@ -303,6 +303,7 @@ unparent_actor (MetaWaylandSurface *surface)
return; return;
parent_actor = clutter_actor_get_parent (actor); parent_actor = clutter_actor_get_parent (actor);
if (parent_actor)
clutter_actor_remove_child (parent_actor, actor); clutter_actor_remove_child (parent_actor, actor);
} }