From 25b5ff52f22ea5f2e46d37628fc443db9428a4bc Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 12 Dec 2011 07:41:27 +0000 Subject: [PATCH] * 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 SVN revision: 66109 --- legacy/ecore/ChangeLog | 8 ++++++++ legacy/ecore/src/lib/ecore/ecore_anim.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index aac665502d..ac9065f18d 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/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/legacy/ecore/src/lib/ecore/ecore_anim.c b/legacy/ecore/src/lib/ecore/ecore_anim.c index 8c5d48d7d0..78abad73ae 100644 --- a/legacy/ecore/src/lib/ecore/ecore_anim.c +++ b/legacy/ecore/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;