[clutter/master-next: 2/3] actor: Provide a destroy implementation



commit 0ac490d087aa46b7dce81e6c4c418d607d6f15a2
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Sat Jan 21 12:16:25 2012 +0000

    actor: Provide a destroy implementation
    
    The destroy() implementation should recursively destroy all children of
    an actor. Doing this inside ClutterActor allows us to do this stuff
    right, and get rid of all the broken variants of child destruction that
    have been popping up every once in a while.

 clutter/clutter-actor.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 677ac39..8df0b17 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -4487,6 +4487,21 @@ clutter_actor_real_has_overlaps (ClutterActor *self)
 }
 
 static void
+clutter_actor_real_destroy (ClutterActor *self)
+{
+  ClutterActor *iter;
+
+  iter = self->priv->first_child;
+  while (iter != NULL)
+    {
+      ClutterActor *next = iter->priv->next_sibling;
+
+      clutter_actor_destroy (iter);
+      iter = next;
+    }
+}
+
+static void
 clutter_actor_class_init (ClutterActorClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -6045,6 +6060,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
   klass->get_paint_volume = clutter_actor_real_get_paint_volume;
   klass->has_overlaps = clutter_actor_real_has_overlaps;
   klass->paint = clutter_actor_real_paint;
+  klass->destroy = clutter_actor_real_destroy;
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]