Ecore animator: delete animater's internal timer in _end_tick() in all cases.
authorDaniel Juyung Seo <seojuyung2@gmail.com>
Tue, 26 Nov 2013 06:58:24 +0000 (15:58 +0900)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Tue, 26 Nov 2013 08:09:37 +0000 (17:09 +0900)
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
NEWS
src/lib/ecore/ecore_anim.c

index 02d0bcb..749486e 100644 (file)
--- 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 bd3adc8..56b44c3 100644 (file)
--- 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.
index 5e99eae..7b33f71 100644 (file)
@@ -88,23 +88,15 @@ _end_tick(void)
 {
    if (!ticking) return;
    ticking = 0;
-   switch (src)
-     {
-      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;
+   if (timer)
+     {
+        _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