From 0dc949709f23ac9835c3fac67239f8c265e0d041 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sat, 10 Apr 2021 10:44:54 +0200 Subject: [PATCH] elm_genlist: ensure item is not deleted while beeing processed the downside of doing things like genlist is doing, is that a object can be deleted, due to the fact that the processing call does not have a eo call in its stack trace, the object is not reffed at all. Hence it simply gets deleted in the middle of beeing proceded. With this, this is at least here not happening. --- src/lib/elementary/elm_genlist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index 342d26e0d3..78b3134138 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -4435,6 +4435,7 @@ _item_mouse_down_cb(void *data, // NOTE: keep this code at the bottom, as the user can change the // list at this point (clear, delete, etc...) _item_highlight(it); + efl_ref(EO_OBJ(it)); if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) { evas_object_smart_callback_call @@ -4443,7 +4444,8 @@ _item_mouse_down_cb(void *data, (WIDGET(it), ELM_GENLIST_EVENT_ACTIVATED, eo_it); } evas_object_smart_callback_call - (WIDGET(it), "pressed", eo_it); + (WIDGET(it), "pressed", eo_it); + efl_unref(EO_OBJ(it)); } static Item_Block *