efl_ui_scroller: free pan object correctly

we need to free the object in the invalidate, not in the destructor.
Otherwise we might leak objects in bindings.

Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10840
This commit is contained in:
Marcel Hollerbach 2019-12-09 18:36:55 +01:00 committed by Cedric BAIL
parent 3a712e2497
commit e81dc6a02b
2 changed files with 12 additions and 4 deletions

View File

@ -278,15 +278,22 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
return obj;
}
EOLIAN static void
_efl_ui_scroller_efl_object_invalidate(Eo *obj, Efl_Ui_Scroller_Data *pd)
{
efl_event_callback_del(pd->pan_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED,
_efl_ui_scroller_pan_resized_cb, obj);
efl_del(pd->pan_obj);
pd->pan_obj = NULL;
efl_invalidate(efl_super(obj, MY_CLASS));
}
EOLIAN static void
_efl_ui_scroller_efl_object_destructor(Eo *obj,
Efl_Ui_Scroller_Data *sd)
{
efl_ui_scroll_connector_unbind(obj);
efl_event_callback_del(sd->pan_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED,
_efl_ui_scroller_pan_resized_cb, obj);
efl_del(sd->pan_obj);
sd->pan_obj = NULL;
sd->smanager = NULL;
efl_destructor(efl_super(obj, MY_CLASS));

View File

@ -24,6 +24,7 @@ class Efl.Ui.Scroller extends Efl.Ui.Layout_Base implements
Efl.Object.constructor;
Efl.Object.finalize;
Efl.Object.destructor;
Efl.Object.invalidate;
Efl.Content.content { get; set; }
Efl.Content.content_unset;
Efl.Canvas.Group.group_calculate;