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.
This commit is contained in:
Marcel Hollerbach 2021-04-10 10:44:54 +02:00
parent b02cef69d1
commit 0dc949709f
1 changed files with 3 additions and 1 deletions

View File

@ -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 *