mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
state: Fix crasher when removing the last key of a transitioning state
If ClutterState is in the middle of a transition and you remove all the keys from the target state, the target state will be destroyed without stopping the animation/unsetting the target state. This caused an invalid memory access.
This commit is contained in:
parent
5700b34b9c
commit
73dcbedc80
@ -302,6 +302,10 @@ again_for_target_state:
|
|||||||
/* no more keys with transitions to this target_state*/
|
/* no more keys with transitions to this target_state*/
|
||||||
if (target_state->keys == NULL)
|
if (target_state->keys == NULL)
|
||||||
{
|
{
|
||||||
|
/* If this state is the current state, unset the state */
|
||||||
|
if (target_state == this->priv->target_state)
|
||||||
|
clutter_state_set_state (this, NULL);
|
||||||
|
|
||||||
/* remove any keys that exist that uses this state as a source */
|
/* remove any keys that exist that uses this state as a source */
|
||||||
clutter_state_remove_key (this, s->data, NULL, NULL, NULL);
|
clutter_state_remove_key (this, s->data, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user