summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-11-06 15:06:17 -0800
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-11-07 22:24:00 +0100
commitb77482e7d6846da1b1cceeda4811829400e921d0 (patch)
tree000e93ecf630e916815e7ee3620d125b951369d3 /src
parentcb60b595d3bbbf9bafed05b7b5fdbf5dd8e04e44 (diff)
elementary: cleanup Eina_Future properly by relying on efl_future_then proper lifecycle.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D10613
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_position_manager_list.c31
1 files 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 d22d42c..34d7e5f 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)
339} 339}
340 340
341static Eina_Value 341static Eina_Value
342_rebuild_job_cb(void *data, Eina_Value v EINA_UNUSED, const Eina_Future *f EINA_UNUSED) 342_rebuild_job_cb(Eo *obj, void *data, const Eina_Value v)
343{ 343{
344 MY_DATA_GET(data, pd); 344 Efl_Ui_Position_Manager_List_Data *pd = data;
345 345
346 if (!efl_alive_get(data)) return EINA_VALUE_EMPTY; 346 cache_require(obj, pd);
347 recalc_absolut_size(obj, pd);
348 position_content(obj, pd);
347 349
348 cache_require(data, pd); 350 return v;
349 recalc_absolut_size(data, pd); 351}
350 position_content(data, pd);
351 pd->rebuild_absolut_size = NULL;
352 352
353 return EINA_VALUE_EMPTY; 353static void
354_rebuild_job_free(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
355{
356 Efl_Ui_Position_Manager_List_Data *pd = data;
357
358 pd->rebuild_absolut_size = NULL;
354} 359}
355 360
356static void 361static void
@@ -358,8 +363,10 @@ schedule_recalc_absolut_size(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd)
358{ 363{
359 if (pd->rebuild_absolut_size) return; 364 if (pd->rebuild_absolut_size) return;
360 365
361 pd->rebuild_absolut_size = efl_loop_job(efl_app_main_get()); 366 pd->rebuild_absolut_size = efl_future_then(obj, efl_loop_job(efl_app_main_get()),
362 eina_future_then(pd->rebuild_absolut_size, _rebuild_job_cb, obj); 367 .success = _rebuild_job_cb,
368 .data = pd,
369 .free = _rebuild_job_free);
363} 370}
364 371
365EOLIAN static void 372EOLIAN static void
@@ -386,7 +393,7 @@ _efl_ui_position_manager_list_efl_ui_position_manager_entity_scroll_position_set
386} 393}
387 394
388EOLIAN static void 395EOLIAN static void
389_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) 396_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)
390{ 397{
391 if (pd->size == 0) 398 if (pd->size == 0)
392 { 399 {
@@ -403,7 +410,7 @@ _efl_ui_position_manager_list_efl_ui_position_manager_entity_item_added(Eo *obj
403} 410}
404 411
405EOLIAN static void 412EOLIAN static void
406_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) 413_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)
407{ 414{
408 pd->size --; 415 pd->size --;
409 if (subobj) 416 if (subobj)