summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTae-Hwan Kim <the81.kim@samsung.com>2014-02-07 18:06:05 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-07 18:06:06 +0900
commit81bd46107c6b3ad9be6de1418990ce59d067dfed (patch)
treeb2ddf309359ceff10a137ed0636d32cefac0b565
parenteb797d538dc742ec8fc4496bcc7daba5c8ffce61 (diff)
[Icon/Layout] Clean-up signal callbacks when signal is freed or layout is deleted. If not, dangling edje callback can be remained at some moment.
Reviewers: raster, cedric, seoz, Hermet Reviewed By: raster Differential Revision: https://phab.enlightenment.org/D509
-rw-r--r--src/lib/elm_icon.c26
-rw-r--r--src/lib/elm_layout.c3
2 files changed, 18 insertions, 11 deletions
diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c
index 53663c561..d45dc64e1 100644
--- a/src/lib/elm_icon.c
+++ b/src/lib/elm_icon.c
@@ -339,12 +339,27 @@ _elm_icon_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
339} 339}
340 340
341static void 341static void
342_edje_signal_callback(void *data,
343 Evas_Object *obj EINA_UNUSED,
344 const char *emission,
345 const char *source)
346{
347 Edje_Signal_Data *esd = data;
348
349 esd->func(esd->data, esd->obj, emission, source);
350}
351
352static void
342_edje_signals_free(Elm_Icon_Smart_Data *sd) 353_edje_signals_free(Elm_Icon_Smart_Data *sd)
343{ 354{
344 Edje_Signal_Data *esd; 355 Edje_Signal_Data *esd;
356 Elm_Image_Smart_Data *id = eo_data_scope_get(sd->obj, ELM_OBJ_IMAGE_CLASS);
345 357
346 EINA_LIST_FREE(sd->edje_signals, esd) 358 EINA_LIST_FREE(sd->edje_signals, esd)
347 { 359 {
360 edje_object_signal_callback_del_full
361 (id->img, esd->emission, esd->source,
362 _edje_signal_callback, esd);
348 eina_stringshare_del(esd->emission); 363 eina_stringshare_del(esd->emission);
349 eina_stringshare_del(esd->source); 364 eina_stringshare_del(esd->source);
350 free(esd); 365 free(esd);
@@ -622,17 +637,6 @@ _elm_icon_signal_emit(Evas_Object *obj,
622 edje_object_signal_emit(id->img, emission, source); 637 edje_object_signal_emit(id->img, emission, source);
623} 638}
624 639
625static void
626_edje_signal_callback(void *data,
627 Evas_Object *obj EINA_UNUSED,
628 const char *emission,
629 const char *source)
630{
631 Edje_Signal_Data *esd = data;
632
633 esd->func(esd->data, esd->obj, emission, source);
634}
635
636/* WARNING: to be deprecated */ 640/* WARNING: to be deprecated */
637void 641void
638_elm_icon_signal_callback_add(Evas_Object *obj, 642_elm_icon_signal_callback_add(Evas_Object *obj,
diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index 7aa68f3bf..515790ee1 100644
--- a/src/lib/elm_layout.c
+++ b/src/lib/elm_layout.c
@@ -812,6 +812,9 @@ _elm_layout_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
812 812
813 EINA_LIST_FREE(sd->edje_signals, esd) 813 EINA_LIST_FREE(sd->edje_signals, esd)
814 { 814 {
815 edje_object_signal_callback_del_full
816 (wd->resize_obj, esd->emission, esd->source,
817 _edje_signal_callback, esd);
815 eina_stringshare_del(esd->emission); 818 eina_stringshare_del(esd->emission);
816 eina_stringshare_del(esd->source); 819 eina_stringshare_del(esd->source);
817 free(esd); 820 free(esd);