Fix the iteration in clutter_group_remove_all()

When iterating on a list while changing it, it's a good idea to keep
pointers around to avoid dirty access bugs.
This commit is contained in:
Emmanuele Bassi 2007-07-04 12:29:50 +00:00
parent 82860b5d5a
commit 0d1777426d

View File

@ -265,7 +265,6 @@ clutter_group_real_remove (ClutterContainer *container,
clutter_actor_queue_redraw (CLUTTER_ACTOR (group));
g_object_unref (actor);
}
static void
@ -454,13 +453,15 @@ clutter_group_remove (ClutterGroup *group,
void
clutter_group_remove_all (ClutterGroup *group)
{
GList *l;
GList *children;
g_return_if_fail (CLUTTER_IS_GROUP (group));
for (l = group->priv->children; l; l = l->next)
children = group->priv->children;
while (children)
{
ClutterActor *child = l->data;
ClutterActor *child = children->data;
children = children->next;
clutter_container_remove_actor (CLUTTER_CONTAINER (group), child);
}