summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2021-04-10 10:44:54 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2021-04-10 13:11:07 +0200
commit0dc949709f23ac9835c3fac67239f8c265e0d041 (patch)
treeeaa8a98610806940c7cf60c3a87fe4e9938e7f70 /src
parentb02cef69d11bcb5b2b8acdf881324959a1756d14 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/elm_genlist.c4
1 files changed, 3 insertions, 1 deletions
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,
4435 // NOTE: keep this code at the bottom, as the user can change the 4435 // NOTE: keep this code at the bottom, as the user can change the
4436 // list at this point (clear, delete, etc...) 4436 // list at this point (clear, delete, etc...)
4437 _item_highlight(it); 4437 _item_highlight(it);
4438 efl_ref(EO_OBJ(it));
4438 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) 4439 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
4439 { 4440 {
4440 evas_object_smart_callback_call 4441 evas_object_smart_callback_call
@@ -4443,7 +4444,8 @@ _item_mouse_down_cb(void *data,
4443 (WIDGET(it), ELM_GENLIST_EVENT_ACTIVATED, eo_it); 4444 (WIDGET(it), ELM_GENLIST_EVENT_ACTIVATED, eo_it);
4444 } 4445 }
4445 evas_object_smart_callback_call 4446 evas_object_smart_callback_call
4446 (WIDGET(it), "pressed", eo_it); 4447 (WIDGET(it), "pressed", eo_it);
4448 efl_unref(EO_OBJ(it));
4447} 4449}
4448 4450
4449static Item_Block * 4451static Item_Block *