From 0b4b1ca1caad41785dadc7d2bd71af6c7b644ada Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 30 Oct 2010 18:11:03 -0400 Subject: [PATCH] Don't leave stale invalidated queued redraws around Once an actor had _clutter_stage_queue_redraw_entry_invalidate() called on it once, then priv->queue_redraw_entry would point to an entry with entry->actor NULL. _clutter_stage_queue_actor_redraw() doesn't handle this case and no further redraws would be queued. To fix this, NULL out priv->queue_redraw_entry() and then make sure we free the invalidated entry in _clutter_stage_maybe_finish_queue_redraws() just as we do for still valid entries. http://bugzilla.clutter-project.org/show_bug.cgi?id=2389 --- clutter/clutter-actor.c | 5 ++++- clutter/clutter-stage.c | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index cf1f3bb94..eb44d047c 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -7654,7 +7654,10 @@ invalidate_queue_redraw_entry (ClutterActor *self, ClutterActorPrivate *priv = self->priv; if (priv->queue_redraw_entry != NULL) - _clutter_stage_queue_redraw_entry_invalidate (priv->queue_redraw_entry); + { + _clutter_stage_queue_redraw_entry_invalidate (priv->queue_redraw_entry); + priv->queue_redraw_entry = NULL; + } return TRUE; } diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 0d067c59e..1cb89ecb9 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -3217,7 +3217,8 @@ _clutter_stage_queue_actor_redraw (ClutterStage *stage, static void free_queue_redraw_entry (ClutterStageQueueRedrawEntry *entry) { - g_object_unref (entry->actor); + if (entry->actor) + g_object_unref (entry->actor); if (entry->has_clip) clutter_paint_volume_free (&entry->clip); g_slice_free (ClutterStageQueueRedrawEntry, entry); @@ -3267,12 +3268,13 @@ _clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage) ClutterPaintVolume *clip; /* NB: Entries may be invalidated if the actor gets destroyed */ - if (G_UNLIKELY (entry->actor == NULL)) - continue; + if (G_LIKELY (entry->actor != NULL)) + { + clip = entry->has_clip ? &entry->clip : NULL; - clip = entry->has_clip ? &entry->clip : NULL; + _clutter_actor_finish_queue_redraw (entry->actor, clip); + } - _clutter_actor_finish_queue_redraw (entry->actor, clip); free_queue_redraw_entry (entry); } g_list_free (stolen_list);