From: raster Date: Mon, 12 Dec 2011 07:41:27 +0000 (+0000) Subject: * Fix bug where an animator that just keeps adding another X-Git-Tag: 2.0_alpha~86^2~135 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e76144610324a0b3c9ca944281cf4cef1360df3c;p=framework%2Fuifw%2Fecore.git * Fix bug where an animator that just keeps adding another animator keeps the animator handler in an infinite loop. Do the same as timers and mark them as "just added" to skip in this run of animators git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@66109 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/ChangeLog b/ChangeLog index aac6655..ac9065f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -395,3 +395,11 @@ * Fix case where SSL certificates would not be used * Added ECORE_CON_REMOTE_CORK for applying TCP_CORK to sends + +2011-12-12 Carsten Haitzler (The Rasterman) + + * Fix bug where an animator that just keeps adding another + animator keeps the animator handler in an infinite loop. Do + the same as timers and mark them as "just added" to skip in + this run of animators + diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c index 8c5d48d..78abad7 100644 --- a/src/lib/ecore/ecore_anim.c +++ b/src/lib/ecore/ecore_anim.c @@ -22,6 +22,7 @@ struct _Ecore_Animator Eina_Bool delete_me : 1; Eina_Bool suspended : 1; + Eina_Bool just_added : 1; }; GENERIC_ALLOC_SIZE_DECLARE(Ecore_Animator); @@ -101,7 +102,13 @@ _do_tick(void) EINA_INLIST_FOREACH(animators, animator) { - if (!animator->delete_me && !animator->suspended) + animator->just_added = EINA_FALSE; + } + EINA_INLIST_FOREACH(animators, animator) + { + if ((!animator->delete_me) && + (!animator->suspended) && + (!animator->just_added)) { if (!_ecore_call_task_cb(animator->func, animator->data)) { @@ -109,6 +116,7 @@ _do_tick(void) animators_delete_me++; } } + else animator->just_added = EINA_FALSE; } if (animators_delete_me) { @@ -149,6 +157,7 @@ _ecore_animator_add(Ecore_Task_Cb func, ECORE_MAGIC_SET(animator, ECORE_MAGIC_ANIMATOR); animator->func = func; animator->data = (void *)data; + animator->just_added = EINA_TRUE; animators = (Ecore_Animator *)eina_inlist_append(EINA_INLIST_GET(animators), EINA_INLIST_GET(animator)); _begin_tick(); return animator;