Edje load: Although we don't use them that much, we have refcounts in evas.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 10 Jun 2012 11:14:42 +0000 (11:14 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 10 Jun 2012 11:14:42 +0000 (11:14 +0000)
Don't assume an evas_object_del has to delete the object.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@71895 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_load.c
src/lib/edje_private.h
src/lib/edje_util.c

index bb7f762..5f5e587 100644 (file)
@@ -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;
index a3718d1..6ef78d4 100644 (file)
@@ -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);
index 20f596c..6f77ba3 100644 (file)
@@ -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 :*/