Skip to content

clutter/actor: Do clutter_actor_destroy_all_children without an iterator

clutter_actor_iter_destroy will try to match up the iterator's age with that of the parent ("root") actor:

g_return_if_fail (ri->age == ri->root->priv->age);

In a simple actor graph that's completely reasonable but somewhere in the more complex graph of gnome-shell the parent's age was skipping ahead faster than that of the iterator. This could happen in theory if the destroy indirectly leads to more children being destroyed than the iterator has visited.

So there's no evidence of actual corruption, only the age check might fail in a clutter_actor_iter_destroy loop because the age check itself can't handle all possible valid scenarios.

Since our only mandate is to destroy all children, we can do that reliably without an iterator and thus without assuming anything about the parent's age counter.

Fixes: gnome-shell#4747 (closed)
although it exposes a new "Object ... has been already disposed" message in gnome-shell, that's probably a good thing because we were failing to destroy all actors in the loop until now. Update: All fixed in gnome-shell!2028 (closed)

Edited by Daniel van Vugt

Merge request reports