[clutter] actor: Add IN_DESTRUCTION checks



commit 1ef85372cc0825c269ac35977ca02da8b12eb6be
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Mon Mar 26 18:31:42 2012 +0100

    actor: Add IN_DESTRUCTION checks
    
    Commit 80626e75842a24c3d0a45068e241ba309f6ec138 removed an
    IN_DESTRUCTION check from within the add_child_internal() method,
    outlining an option for bringing it back. It was too late for the 1.10
    cycle to do it, and eventually pick up the pieces, but now that we're
    at the beginning of the 1.11 cycle we can restore it, and add checks
    elsewhere to balance it.

 clutter/clutter-actor.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 5f6e801..1901057 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -11761,6 +11761,11 @@ clutter_actor_set_child_above_sibling (ClutterActor *self,
   if (sibling != NULL)
     g_return_if_fail (sibling->priv->parent == self);
 
+  if (CLUTTER_ACTOR_IN_DESTRUCTION (self) ||
+      CLUTTER_ACTOR_IN_DESTRUCTION (child) ||
+      (sibling != NULL && CLUTTER_ACTOR_IN_DESTRUCTION (sibling)))
+    return;
+
   /* we don't want to change the state of child, or emit signals, or
    * regenerate ChildMeta instances here, but we still want to follow
    * the correct sequence of steps encoded in remove_child() and
@@ -11807,6 +11812,11 @@ clutter_actor_set_child_below_sibling (ClutterActor *self,
   if (sibling != NULL)
     g_return_if_fail (sibling->priv->parent == self);
 
+  if (CLUTTER_ACTOR_IN_DESTRUCTION (self) ||
+      CLUTTER_ACTOR_IN_DESTRUCTION (child) ||
+      (sibling != NULL && CLUTTER_ACTOR_IN_DESTRUCTION (sibling)))
+    return;
+
   /* see the comment in set_child_above_sibling() */
   g_object_ref (child);
   clutter_actor_remove_child_internal (self, child, 0);
@@ -11842,6 +11852,10 @@ clutter_actor_set_child_at_index (ClutterActor *self,
   g_return_if_fail (child->priv->parent == self);
   g_return_if_fail (index_ <= self->priv->n_children);
 
+  if (CLUTTER_ACTOR_IN_DESTRUCTION (self) ||
+      CLUTTER_ACTOR_IN_DESTRUCTION (child))
+    return;
+
   g_object_ref (child);
   clutter_actor_remove_child_internal (self, child, 0);
   clutter_actor_add_child_internal (self, child,



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