scene: make graph loops fatal when debugging

This commit is contained in:
Devin J. Pohly 2021-08-29 13:57:07 -05:00 committed by Simon Ser
parent 0f534e32e4
commit d5263be355

View File

@ -141,9 +141,7 @@ void wlr_scene_node_reparent(struct wlr_scene_node *node,
/* Ensure that a node cannot become its own ancestor */
for (struct wlr_scene_node *ancestor = new_parent; ancestor != NULL;
ancestor = ancestor->parent) {
if (ancestor == node) {
return;
}
assert(ancestor != node);
}
wl_list_remove(&node->state.link);