[clutter] ClutterActor: clear redraw entry before emitting signals



commit 018ede2b24079089e2c4e84698776a1235dbde20
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu Mar 1 22:58:39 2012 +0100

    ClutterActor: clear redraw entry before emitting signals
    
    If the redraw entry is not cleared, queueing a redraw from a signal
    handler could reinsert the same object in the stage redraw list,
    causing the segfault later (as the object is immediately freed)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671173

 clutter/clutter-actor.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index eb838ae..3dd40c1 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -6537,6 +6537,14 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
   ClutterPaintVolume *pv;
   gboolean clipped;
 
+  /* Remove queue entry early in the process, otherwise a new
+     queue_redraw() during signal handling could put back this
+     object in the stage redraw list (but the entry is freed as
+     soon as we return from this function, causing a segfault
+     later)
+  */
+  priv->queue_redraw_entry = NULL;
+
   /* If we've been explicitly passed a clip volume then there's
    * nothing more to calculate, but otherwise the only thing we know
    * is that the change is constrained to the given actor.
@@ -6595,8 +6603,6 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
    */
   if (G_LIKELY (clipped))
     _clutter_actor_set_queue_redraw_clip (self, NULL);
-
-  priv->queue_redraw_entry = NULL;
 }
 
 static void



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