[clutter] actor: Ensure the validity of the queue_redraw_entry pointer
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] actor: Ensure the validity of the queue_redraw_entry pointer
- Date: Sat, 14 May 2011 00:17:14 +0000 (UTC)
commit f9d7650b97c3788763e14ce3b39f21f19edc41bb
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
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 49ef0aa..fe97b75 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -8239,15 +8239,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,
@@ -8258,6 +8249,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]