elementary: prevent early death of items.
authorCedric BAIL <cedric.bail@free.fr>
Fri, 2 Dec 2011 16:00:41 +0000 (16:00 +0000)
committerCedric BAIL <cedric.bail@free.fr>
Fri, 2 Dec 2011 16:00:41 +0000 (16:00 +0000)
SVN revision: 65824

src/lib/elm_genlist.c

index 62aef74..c11da64 100644 (file)
@@ -3789,7 +3789,12 @@ _elm_genlist_clear(Evas_Object *obj, Eina_Bool standby)
 
         if (it->generation < wd->generation)
           {
+             Elm_Gen_Item *itn = NULL;
+
+             if (next) itn = ELM_GEN_ITEM_FROM_INLIST(next);
+             if (itn) itn->walking++; /* prevent early death of subitem */
              it->del_cb(it);
+             if (itn) itn->walking--;
           }
      }
    wd->clear_me = 0;
@@ -4337,6 +4342,11 @@ elm_genlist_item_del(Elm_Gen_Item *it)
              if (it->wd->calc_job) ecore_job_del(it->wd->calc_job);
              it->wd->calc_job = ecore_job_add(_calc_job, it->wd);
           }
+        if (it->parent)
+          {
+             it->parent->item->items = eina_list_remove(it->parent->item->items, it);
+             it->parent = NULL;
+          }
         return;
      }
    _item_del(it);