mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 16:34:10 +00:00
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
This commit is contained in:
parent
5aa8ed93ce
commit
f9d7650b97
@ -8239,15 +8239,6 @@ clutter_actor_unparent (ClutterActor *self)
|
|||||||
if (priv->parent_actor == NULL)
|
if (priv->parent_actor == NULL)
|
||||||
return;
|
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);
|
was_mapped = CLUTTER_ACTOR_IS_MAPPED (self);
|
||||||
|
|
||||||
/* we need to unrealize *before* we set parent_actor to NULL,
|
/* 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);
|
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;
|
old_parent = priv->parent_actor;
|
||||||
priv->parent_actor = NULL;
|
priv->parent_actor = NULL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user