From d6adf3f60e546575f8b9404573b716ab7ef19719 Mon Sep 17 00:00:00 2001 From: tasn Date: Sun, 10 Jun 2012 11:14:42 +0000 Subject: [PATCH] Edje load: Although we don't use them that much, we have refcounts in evas. Don't assume an evas_object_del has to delete the object. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@71895 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_load.c | 2 +- src/lib/edje_private.h | 1 + src/lib/edje_util.c | 12 +++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/edje_load.c b/src/lib/edje_load.c index bb7f762..5f5e587 100644 --- a/src/lib/edje_load.c +++ b/src/lib/edje_load.c @@ -1234,7 +1234,7 @@ _edje_file_del(Edje *ed) } if (ed->L) _edje_lua2_script_shutdown(ed); - while (ed->subobjs) evas_object_del(ed->subobjs->data); + while (ed->subobjs) _edje_subobj_unregister(ed, ed->subobjs->data); if (ed->table_parts) free(ed->table_parts); ed->table_parts = NULL; ed->table_parts_size = 0; diff --git a/src/lib/edje_private.h b/src/lib/edje_private.h index a3718d1..6ef78d4 100644 --- a/src/lib/edje_private.h +++ b/src/lib/edje_private.h @@ -2115,6 +2115,7 @@ void _edje_lib_ref(void); void _edje_lib_unref(void); void _edje_subobj_register(Edje *ed, Evas_Object *ob); +void _edje_subobj_unregister(Edje *ed, Evas_Object *ob); void _edje_multisense_init(void); void _edje_multisense_shutdown(void); diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c index 20f596c..6f77ba3 100644 --- a/src/lib/edje_util.c +++ b/src/lib/edje_util.c @@ -5225,9 +5225,7 @@ static void _cb_subobj_del(void *data, __UNUSED__ Evas *e, Evas_Object *obj, __UNUSED__ void *event_info) { Edje *ed = data; - ed->subobjs = eina_list_remove(ed->subobjs, obj); - evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL, - _cb_subobj_del, ed); + _edje_subobj_unregister(ed, obj); } void @@ -5238,4 +5236,12 @@ _edje_subobj_register(Edje *ed, Evas_Object *ob) _cb_subobj_del, ed); } +void +_edje_subobj_unregister(Edje *ed, Evas_Object *obj) +{ + ed->subobjs = eina_list_remove(ed->subobjs, obj); + evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL, + _cb_subobj_del, ed); +} + /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ -- 2.7.4