diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 19207174b..946544eab 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -10466,24 +10466,18 @@ clutter_actor_remove_child (ClutterActor *self, void clutter_actor_remove_all_children (ClutterActor *self) { - ClutterActor *iter; + ClutterActorIter iter; g_return_if_fail (CLUTTER_IS_ACTOR (self)); if (self->priv->n_children == 0) return; - iter = self->priv->first_child; - while (iter != NULL) - { - ClutterActor *next = iter->priv->next_sibling; - - clutter_actor_remove_child_internal (self, iter, - REMOVE_CHILD_DEFAULT_FLAGS); - - iter = next; - } + clutter_actor_iter_init (&iter, self); + while (clutter_actor_iter_next (&iter, NULL)) + clutter_actor_iter_remove (&iter); + /* sanity check */ g_assert (self->priv->first_child == NULL); g_assert (self->priv->last_child == NULL); g_assert (self->priv->n_children == 0);