mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
clutter-group: Use g_list_foreach in clutter_group_real_foreach
g_list_foreach has better protection against the current node being removed. This will happen for example if someone calls clutter_container_foreach(container, clutter_actor_destroy). This was causing valgrind errors for the conformance tests which do just that.
This commit is contained in:
parent
3d373c7278
commit
ce030a3fce
@ -277,10 +277,12 @@ clutter_group_real_foreach (ClutterContainer *container,
|
||||
{
|
||||
ClutterGroup *group = CLUTTER_GROUP (container);
|
||||
ClutterGroupPrivate *priv = group->priv;
|
||||
GList *l;
|
||||
|
||||
for (l = priv->children; l; l = l->next)
|
||||
(* callback) (CLUTTER_ACTOR (l->data), user_data);
|
||||
/* Using g_list_foreach instead of iterating the list manually
|
||||
because it has better protection against the current node being
|
||||
removed. This will happen for example if someone calls
|
||||
clutter_container_foreach(container, clutter_actor_destroy) */
|
||||
g_list_foreach (priv->children, (GFunc) callback, user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user