* 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
This commit is contained in:
Carsten Haitzler 2011-12-12 07:41:27 +00:00
parent b0ddea7508
commit 25b5ff52f2
2 changed files with 18 additions and 1 deletions

View File

@ -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

View File

@ -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;