diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2015-09-29 14:15:16 -0400 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2015-09-29 14:15:16 -0400 |
commit | 76c8cd292ed269bd75e7482d96fd4209076d2266 (patch) | |
tree | 07cb334c1aeada956e21feccd04c3ed1cd07e895 | |
parent | 86a65ddffc511418e1aff48c4b8b9b7f7caa75f3 (diff) | |
download | clutter-76c8cd292ed269bd75e7482d96fd4209076d2266.tar.gz |
Avoid crashing when an actor not parented to a toplevel is cloned
If we can't realize the source actor for a clone, simply skip updating
the map state and painting it.
https://bugzilla.gnome.org/show_bug.cgi?id=745517
-rw-r--r-- | clutter/clutter-actor.c | 6 | ||||
-rw-r--r-- | clutter/clutter-clone.c | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index ad106c452..53c1354f0 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -15938,7 +15938,11 @@ _clutter_actor_set_enable_paint_unmapped (ClutterActor *self, */ clutter_actor_realize (self); - clutter_actor_update_map_state (self, MAP_STATE_MAKE_MAPPED); + /* If the actor isn't ultimately connected to a toplevel, it can't be + * realized or painted. + */ + if (CLUTTER_ACTOR_IS_REALIZED (self)) + clutter_actor_update_map_state (self, MAP_STATE_MAKE_MAPPED); } else { diff --git a/clutter/clutter-clone.c b/clutter/clutter-clone.c index a84c7feaa..eb91915c3 100644 --- a/clutter/clutter-clone.c +++ b/clutter/clutter-clone.c @@ -184,9 +184,15 @@ clutter_clone_paint (ClutterActor *actor) was_unmapped = TRUE; } - _clutter_actor_push_clone_paint (); - clutter_actor_paint (priv->clone_source); - _clutter_actor_pop_clone_paint (); + /* If the source isn't ultimately parented to a toplevel, it can't be + * realized or painted. + */ + if (clutter_actor_is_realized (priv->clone_source)) + { + _clutter_actor_push_clone_paint (); + clutter_actor_paint (priv->clone_source); + _clutter_actor_pop_clone_paint (); + } if (was_unmapped) _clutter_actor_set_enable_paint_unmapped (priv->clone_source, FALSE); |