bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0dc949709f23ac9835c3fac67239f8c265e0d041

commit 0dc949709f23ac9835c3fac67239f8c265e0d041
Author: Marcel Hollerbach <m...@marcel-hollerbach.de>
Date:   Sat Apr 10 10:44:54 2021 +0200

    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 *

-- 


Reply via email to