From e78c4e68f54e4b154ceb4601d67a2782a3c8e4aa Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Tue, 26 Nov 2013 15:58:24 +0900 Subject: [PATCH] Ecore animator: delete animater's internal timer in _end_tick() in all cases. When the ecore_animator_source_set() is called with different sources repeatedly, sometimes internal timer is not deleted and this leads animator misbehavior. Especially when the source is changed from ECORE_ANIMATOR_SOURCE_TIMER to ECORE_ANIMATOR_SOURCE_CUSTOM before the SOURCE_TIMER's internal timer is deleted, this problem occurs. In this case, even though _end_tick() is called in ecore_animator_source_set(), the SOURCE_TIMER's timer is not deleted because the source is already changed to CUSTOM. So we should delete the internal timer in _end_tick() in all cases. --- ChangeLog | 5 +++++ NEWS | 1 + src/lib/ecore/ecore_anim.c | 22 +++++++--------------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02d0bcb2c5..749486e97b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-26 Daniel Juyung Seo (SeoZ) + + * ecore anim: Fixed animator not working problem when source_set is + changed back and forth very fast. + 2013-11-26 Cedric Bail * Evas: Allow fuzziness on the texture format returned by GL. diff --git a/NEWS b/NEWS index bd3adc8cb7..56b44c3069 100644 --- a/NEWS +++ b/NEWS @@ -369,6 +369,7 @@ Fixes: * Ecore: - Don't leak fd on exec. - Fix fd handler increase issue when ecore_pipe_add/del is called repeatedly. + - Fixed animator not working problem when source_set is changed back and forth very fast. * Ecore_Con: - Fix a memory leak in ecore_con_dns when using ecore_con_server_connect. - Don't leak fd on exec. diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c index 5e99eaeed7..7b33f71385 100644 --- a/src/lib/ecore/ecore_anim.c +++ b/src/lib/ecore/ecore_anim.c @@ -88,23 +88,15 @@ _end_tick(void) { if (!ticking) return; ticking = 0; - switch (src) + + if (timer) { - case ECORE_ANIMATOR_SOURCE_TIMER: - if (timer) - { - _ecore_timer_del(timer); - timer = NULL; - } - break; - - case ECORE_ANIMATOR_SOURCE_CUSTOM: - if (end_tick_cb) end_tick_cb((void *)end_tick_data); - break; - - default: - break; + _ecore_timer_del(timer); + timer = NULL; } + + if ((src == ECORE_ANIMATOR_SOURCE_CUSTOM) && end_tick_cb) + end_tick_cb((void *)end_tick_data); } static Eina_Bool