summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-09 18:36:55 +0100
committerCedric BAIL <cedric.bail@free.fr>2019-12-13 09:32:57 -0800
commite81dc6a02b637b394a59490527134434d4309523 (patch)
tree10985834ed274d7508333357957e4268bdd03d7b
parent3a712e2497857aa53ddcbe35715261bdaa23c272 (diff)
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
-rw-r--r--src/lib/elementary/efl_ui_scroller.c15
-rw-r--r--src/lib/elementary/efl_ui_scroller.eo1
2 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c
index 92b99527bf..5c79c2eec7 100644
--- a/src/lib/elementary/efl_ui_scroller.c
+++ b/src/lib/elementary/efl_ui_scroller.c
@@ -279,14 +279,21 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
279} 279}
280 280
281EOLIAN static void 281EOLIAN static void
282_efl_ui_scroller_efl_object_invalidate(Eo *obj, Efl_Ui_Scroller_Data *pd)
283{
284 efl_event_callback_del(pd->pan_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED,
285 _efl_ui_scroller_pan_resized_cb, obj);
286 efl_del(pd->pan_obj);
287 pd->pan_obj = NULL;
288
289 efl_invalidate(efl_super(obj, MY_CLASS));
290}
291
292EOLIAN static void
282_efl_ui_scroller_efl_object_destructor(Eo *obj, 293_efl_ui_scroller_efl_object_destructor(Eo *obj,
283 Efl_Ui_Scroller_Data *sd) 294 Efl_Ui_Scroller_Data *sd)
284{ 295{
285 efl_ui_scroll_connector_unbind(obj); 296 efl_ui_scroll_connector_unbind(obj);
286 efl_event_callback_del(sd->pan_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED,
287 _efl_ui_scroller_pan_resized_cb, obj);
288 efl_del(sd->pan_obj);
289 sd->pan_obj = NULL;
290 sd->smanager = NULL; 297 sd->smanager = NULL;
291 298
292 efl_destructor(efl_super(obj, MY_CLASS)); 299 efl_destructor(efl_super(obj, MY_CLASS));
diff --git a/src/lib/elementary/efl_ui_scroller.eo b/src/lib/elementary/efl_ui_scroller.eo
index 22a99b8a80..46f256382d 100644
--- a/src/lib/elementary/efl_ui_scroller.eo
+++ b/src/lib/elementary/efl_ui_scroller.eo
@@ -24,6 +24,7 @@ class Efl.Ui.Scroller extends Efl.Ui.Layout_Base implements
24 Efl.Object.constructor; 24 Efl.Object.constructor;
25 Efl.Object.finalize; 25 Efl.Object.finalize;
26 Efl.Object.destructor; 26 Efl.Object.destructor;
27 Efl.Object.invalidate;
27 Efl.Content.content { get; set; } 28 Efl.Content.content { get; set; }
28 Efl.Content.content_unset; 29 Efl.Content.content_unset;
29 Efl.Canvas.Group.group_calculate; 30 Efl.Canvas.Group.group_calculate;