summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2015-05-17 14:59:06 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2015-05-18 08:47:59 +0300
commitda652191a7c90262af014f39a77ea0a025ad67ef (patch)
tree3f0b7a66bea13237a044bdba3094731250d6413d
parentce33c77315929b58ee5e1685523a2860208e68b1 (diff)
SlideShow: Fix double invocation of ItemClass delete function
When closing the application, the delete function given by the user in the Item Class was called twice. During the clear process, the function was called for every built item and then during the item destruction. This patch fixes this behaviour by calling the user function only during the item destruction. Another fix has been added. It zero'es the built list pointer inside the item. Without this fix, the item points to a list node that is already freed and can lead during widget deletion to an invalid access inside the list. @fix T2394
-rw-r--r--src/lib/elm_slideshow.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c
index aae7150fd..08fd69901 100644
--- a/src/lib/elm_slideshow.c
+++ b/src/lib/elm_slideshow.c
@@ -238,6 +238,7 @@ _item_realize(Elm_Slideshow_Item_Data *item)
238 if (item->itc->func.del) 238 if (item->itc->func.del)
239 item->itc->func.del(elm_object_item_data_get(EO_OBJ(item)), VIEW(item)); 239 item->itc->func.del(elm_object_item_data_get(EO_OBJ(item)), VIEW(item));
240 ELM_SAFE_FREE(VIEW(item), evas_object_del); 240 ELM_SAFE_FREE(VIEW(item), evas_object_del);
241 item->l_built = NULL;
241 } 242 }
242} 243}
243 244
@@ -628,19 +629,13 @@ _elm_slideshow_loop_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
628EOLIAN static void 629EOLIAN static void
629_elm_slideshow_clear(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd) 630_elm_slideshow_clear(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
630{ 631{
631 Elm_Slideshow_Item_Data *item;
632 Eo *eo_item; 632 Eo *eo_item;
633 633 Eina_List *itr, *itr2;
634 sd->previous = NULL; 634 sd->previous = NULL;
635 sd->current = NULL; 635 sd->current = NULL;
636 EINA_LIST_FREE(sd->items_built, item)
637 {
638 if (item->itc->func.del)
639 item->itc->func.del(elm_object_item_data_get(EO_OBJ(item)), VIEW(item));
640 }
641 636
642 EINA_LIST_FREE(sd->items, eo_item) 637 EINA_LIST_FOREACH_SAFE(sd->items, itr, itr2, eo_item)
643 eo_del(eo_item); 638 eo_del(eo_item);
644} 639}
645 640
646EOLIAN static const Eina_List* 641EOLIAN static const Eina_List*