[clutter/clutter-1.6] actor: Ensure the validity of the queue_redraw_entry pointer



commit f3532c3335d963402c5dc38d388c41e2491b0be4
Author: Chris Lord <chris linux intel com>
Date:   Mon Mar 28 16:10:59 2011 +0100

    actor: Ensure the validity of the queue_redraw_entry pointer
    
    In _clutter_actor_queue_redraw_with_clip, there was the possibility that
    the actor will add itself to the stage's redraw queue without keeping track
    of the allocated list member.
    
    In clutter_actor_unparent, the redraw queue entry was being invalidated
    before the mapped notify signal was being fired, meaning that queueing a
    redraw of an unmapped actor in the mapped notification callback could
    cause a crash.
    
    http://bugzilla.clutter-project.org/show_bug.cgi?id=2621
    (cherry picked from commit f9d7650b97c3788763e14ce3b39f21f19edc41bb)
    
    Signed-off-by: Emmanuele Bassi <ebassi linux intel com>

 clutter/clutter-actor.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 23ef9b8..26d6d90 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -7738,15 +7738,6 @@ clutter_actor_unparent (ClutterActor *self)
   if (priv->parent_actor == NULL)
     return;
 
-   /* We take this opportunity to invalidate any queue redraw entry
-    * associated with the actor and descendants since we won't be able to
-    * determine the appropriate stage after this. */
-  _clutter_actor_traverse (self,
-                           0,
-                           invalidate_queue_redraw_entry,
-                           NULL,
-                           NULL);
-
   was_mapped = CLUTTER_ACTOR_IS_MAPPED (self);
 
   /* we need to unrealize *before* we set parent_actor to NULL,
@@ -7757,6 +7748,15 @@ clutter_actor_unparent (ClutterActor *self)
    */
   clutter_actor_update_map_state (self, MAP_STATE_MAKE_UNREALIZED);
 
+   /* We take this opportunity to invalidate any queue redraw entry
+    * associated with the actor and descendants since we won't be able to
+    * determine the appropriate stage after this. */
+  _clutter_actor_traverse (self,
+                           0,
+                           invalidate_queue_redraw_entry,
+                           NULL,
+                           NULL);
+
   old_parent = priv->parent_actor;
   priv->parent_actor = NULL;
 



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