From 3093b5c95d8fc690568e63a3eb691f2bfe4033cc Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 27 Feb 2013 17:47:48 +0100 Subject: [PATCH] MetaBackgroundGroup: don't use clutter_actor_get_children() In C code we can use ClutterActorIter and avoid allocating a GList. --- src/compositor/meta-background-group.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/compositor/meta-background-group.c b/src/compositor/meta-background-group.c index 01dd27a87..cf08843b3 100644 --- a/src/compositor/meta-background-group.c +++ b/src/compositor/meta-background-group.c @@ -73,13 +73,12 @@ void meta_background_group_set_visible_region (MetaBackgroundGroup *self, cairo_region_t *region) { - GList *children, *l; + ClutterActorIter iter; + ClutterActor *actor; - children = clutter_actor_get_children (CLUTTER_ACTOR (self)); - for (l = children; l; l = l->next) + clutter_actor_iter_init (&iter, CLUTTER_ACTOR (self)); + while (clutter_actor_iter_next (&iter, &actor)) { - ClutterActor *actor = l->data; - if (META_IS_BACKGROUND_ACTOR (actor)) { meta_background_actor_set_visible_region (META_BACKGROUND_ACTOR (actor), region); @@ -96,7 +95,6 @@ meta_background_group_set_visible_region (MetaBackgroundGroup *self, cairo_region_translate (region, x, y); } } - g_list_free (children); } ClutterActor *