From 018ede2b24079089e2c4e84698776a1235dbde20 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Thu, 1 Mar 2012 22:58:39 +0100 Subject: [PATCH] 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 file 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 -- 2.7.4