mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
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:
parent
82860b5d5a
commit
0d1777426d
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user