[Genlist] Fix genlist crash problem.
authorTae-Hwan Kim <the81.kim@samsung.com>
Wed, 12 Jun 2013 08:51:15 +0000 (17:51 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Thu, 20 Jun 2013 12:30:16 +0000 (21:30 +0900)
There is two delete procedure
1. _item_free
2. _item_del_pre_process

focus NULL set should be added to _item_del_pre_process also

Change-Id: I9e05ad671a83bbeef005d18487946e2bbb17a25b

src/lib/elm_genlist.c

index 15b1e33..88f9580 100644 (file)
@@ -5355,6 +5355,7 @@ _item_free(Elm_Gen_Item *it)
    if (it->tooltip.del_cb)
      it->tooltip.del_cb((void *)it->tooltip.data, WIDGET(it), it);
    _item_free_common(it);
+
    _item_unrealize(it, EINA_FALSE);
    elm_genlist_item_class_unref((Elm_Genlist_Item_Class *)it->itc);
    free(it->item);
@@ -5418,6 +5419,7 @@ _item_del_pre_process(Elm_Gen_Item *it)
           sd->pending_del_items = eina_list_append(sd->pending_del_items, it);
      }
 
+   if (sd->focused == it) sd->focused = NULL;
    elm_widget_item_pre_notify_del(it);
    if (it->itc->func.del)
      it->itc->func.del((void *)it->base.data, WIDGET(it));