ecore: Add _SAFE when iterating the animators.
authorLauro Moura <lauromoura@expertisesolutions.com.br>
Fri, 12 Aug 2016 22:53:07 +0000 (19:53 -0300)
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>
Tue, 25 Oct 2016 14:23:34 +0000 (12:23 -0200)
In some cases (like JS libuv events) an animator callback can trigger the
deletion of an animator, changing the list being iterated.

src/lib/ecore/ecore_anim.c

index 66d08cf..70c2f89 100644 (file)
@@ -271,13 +271,14 @@ static Eina_Bool
 _do_tick(void)
 {
    Ecore_Animator *animator;
+   Eina_Inlist *tmp;
 
    EINA_INLIST_FOREACH(animators, animator)
      {
         animator->just_added = EINA_FALSE;
      }
    if (animators) eina_evlog("!FRAME", NULL, ecore_loop_time_get(), NULL);
-   EINA_INLIST_FOREACH(animators, animator)
+   EINA_INLIST_FOREACH_SAFE(animators, tmp, animator)
      {
         if ((!animator->delete_me) &&
             (!animator->suspended) &&