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
This commit is contained in:
parent
cb60b595d3
commit
b77482e7d6
|
@ -339,18 +339,23 @@ position_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Value
|
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);
|
||||||
|
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
cache_require(data, pd);
|
|
||||||
recalc_absolut_size(data, pd);
|
|
||||||
position_content(data, pd);
|
|
||||||
pd->rebuild_absolut_size = NULL;
|
pd->rebuild_absolut_size = NULL;
|
||||||
|
|
||||||
return EINA_VALUE_EMPTY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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;
|
if (pd->rebuild_absolut_size) return;
|
||||||
|
|
||||||
pd->rebuild_absolut_size = efl_loop_job(efl_app_main_get());
|
pd->rebuild_absolut_size = efl_future_then(obj, efl_loop_job(efl_app_main_get()),
|
||||||
eina_future_then(pd->rebuild_absolut_size, _rebuild_job_cb, obj);
|
.success = _rebuild_job_cb,
|
||||||
|
.data = pd,
|
||||||
|
.free = _rebuild_job_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
|
@ -386,7 +393,7 @@ _efl_ui_position_manager_list_efl_ui_position_manager_entity_scroll_position_set
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
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)
|
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
|
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 --;
|
pd->size --;
|
||||||
if (subobj)
|
if (subobj)
|
||||||
|
|
Loading…
Reference in New Issue