discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=2fd7b01f4371e24208c245949d64fcc8f2042b7c

commit 2fd7b01f4371e24208c245949d64fcc8f2042b7c
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu May 28 11:58:46 2015 -0400

    gengrid/genlist: decrement item counter before triggering item del callback
    
    @fix
---
 src/lib/elm_gengrid.c | 3 +--
 src/lib/elm_genlist.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 3e43356..688ef19 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -3306,6 +3306,7 @@ _elm_gengrid_item_del_serious(Elm_Gen_Item *it)
 {
    ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
 
+   sd->item_count--;
    _elm_gengrid_item_del_not_serious(it);
    sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(it));
    if (it->tooltip.del_cb)
@@ -3319,8 +3320,6 @@ _elm_gengrid_item_del_serious(Elm_Gen_Item *it)
    ecore_job_del(sd->calc_job);
    sd->calc_job = ecore_job_add(sd->calc_cb, sd->obj);
 
-   sd->item_count--;
-
    ELM_SAFE_FREE(it->item, free);
 }
 
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 7b0853f..50a3ffc 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -3556,6 +3556,7 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it)
 {
    ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd);
 
+   sd->item_count--;
    _elm_genlist_item_del_not_serious(it);
 
    //(it->walking == -1) means it's already removed from the list.
@@ -3571,8 +3572,6 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it)
    ecore_job_del(sd->calc_job);
    sd->calc_job = ecore_job_add(_calc_job, sd->obj);
 
-   sd->item_count--;
-
    ELM_SAFE_FREE(it->item, free);
 }
 

-- 


Reply via email to