From 4640dad6afdce4469b64cef3fea9a426afcb0ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Fri, 24 Sep 2010 13:28:08 +0100 Subject: [PATCH] animator: fix removal of all keys When removing all keys in a ClutterAnimator, the hash table with object/property name pairs went out of sync. This change makes the animator always clear this hash table upon key-removal; and refreshing it if the animator's timeline is running. Fixes bug #2335 --- clutter/clutter-animator.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/clutter/clutter-animator.c b/clutter/clutter-animator.c index d0a90f112..f43ac99e9 100644 --- a/clutter/clutter-animator.c +++ b/clutter/clutter-animator.c @@ -1445,23 +1445,14 @@ again: } } - if (object) - { - GHashTableIter iter; - gpointer key, value; + /* clear off cached state for all properties, this is regenerated in a + * correct state by animation_animator_started + */ + g_hash_table_remove_all (priv->properties); -again2: - g_hash_table_iter_init (&iter, priv->properties); - while (g_hash_table_iter_next (&iter, &key, &value)) - { - PropObjectKey *prop_actor_key = key; - if (prop_actor_key->object == object) - { - g_hash_table_remove (priv->properties, key); - goto again2; - } - } - } + /* if the animator is already running reinitialize internal iterators */ + if (clutter_timeline_is_playing (priv->timeline)) + animation_animator_started (priv->timeline, animator); } /**