bu5hm4n pushed a commit to branch master.

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

commit b77482e7d6846da1b1cceeda4811829400e921d0
Author: Cedric BAIL <cedric.b...@free.fr>
Date:   Wed Nov 6 15:06:17 2019 -0800

    elementary: cleanup Eina_Future properly by relying on efl_future_then 
proper lifecycle.
    
    Reviewed-by: Marcel Hollerbach <m...@marcel-hollerbach.de>
    Differential Revision: https://phab.enlightenment.org/D10613
---
 src/lib/elementary/efl_ui_position_manager_list.c | 31 ++++++++++++++---------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/src/lib/elementary/efl_ui_position_manager_list.c 
b/src/lib/elementary/efl_ui_position_manager_list.c
index d22d42cb10..34d7e5f073 100644
--- a/src/lib/elementary/efl_ui_position_manager_list.c
+++ b/src/lib/elementary/efl_ui_position_manager_list.c
@@ -339,18 +339,23 @@ position_content(Eo *obj EINA_UNUSED, 
Efl_Ui_Position_Manager_List_Data *pd)
 }
 
 static Eina_Value
-_rebuild_job_cb(void *data, Eina_Value v EINA_UNUSED, const Eina_Future *f 
EINA_UNUSED)
+_rebuild_job_cb(Eo *obj, void *data, const Eina_Value v)
 {
-   MY_DATA_GET(data, pd);
+   Efl_Ui_Position_Manager_List_Data *pd = data;
 
-   if (!efl_alive_get(data)) return EINA_VALUE_EMPTY;
+   cache_require(obj, pd);
+   recalc_absolut_size(obj, pd);
+   position_content(obj, pd);
 
-   cache_require(data, pd);
-   recalc_absolut_size(data, pd);
-   position_content(data, pd);
-   pd->rebuild_absolut_size = NULL;
+   return v;
+}
 
-   return EINA_VALUE_EMPTY;
+static void
+_rebuild_job_free(Eo *o EINA_UNUSED, void *data, const Eina_Future 
*dead_future EINA_UNUSED)
+{
+   Efl_Ui_Position_Manager_List_Data *pd = data;
+
+   pd->rebuild_absolut_size = NULL;
 }
 
 static void
@@ -358,8 +363,10 @@ schedule_recalc_absolut_size(Eo *obj, 
Efl_Ui_Position_Manager_List_Data *pd)
 {
    if (pd->rebuild_absolut_size) return;
 
-   pd->rebuild_absolut_size = efl_loop_job(efl_app_main_get());
-   eina_future_then(pd->rebuild_absolut_size, _rebuild_job_cb, obj);
+   pd->rebuild_absolut_size = efl_future_then(obj, 
efl_loop_job(efl_app_main_get()),
+                                              .success = _rebuild_job_cb,
+                                              .data = pd,
+                                              .free = _rebuild_job_free);
 }
 
 EOLIAN static void
@@ -386,7 +393,7 @@ 
_efl_ui_position_manager_list_efl_ui_position_manager_entity_scroll_position_set
 }
 
 EOLIAN static void
-_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_added(Eo 
*obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, int added_index 
EINA_UNUSED, Efl_Gfx_Entity *subobj)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_added(Eo 
*obj, Efl_Ui_Position_Manager_List_Data *pd, int added_index EINA_UNUSED, 
Efl_Gfx_Entity *subobj)
 {
    if (pd->size == 0)
      {
@@ -403,7 +410,7 @@ 
_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_added(Eo *obj
 }
 
 EOLIAN static void
-_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_removed(Eo 
*obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, int removed_index 
EINA_UNUSED, Efl_Gfx_Entity *subobj)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_removed(Eo 
*obj, Efl_Ui_Position_Manager_List_Data *pd, int removed_index EINA_UNUSED, 
Efl_Gfx_Entity *subobj)
 {
    pd->size --;
    if (subobj)

-- 


Reply via email to