if (ed->collection->references <= 0)
{
ed->file->collection_hash = evas_hash_del(ed->file->collection_hash, ed->part, ed->collection);
- _edje_collection_free(ed->collection);
+ _edje_collection_free(ed, ed->collection);
}
ed->collection = NULL;
}
while (ed->parts)
{
Edje_Real_Part *rp;
-
+
rp = ed->parts->data;
ed->parts = evas_list_remove(ed->parts, rp);
evas_object_event_callback_del(rp->object,
evas_object_event_callback_del(rp->object,
EVAS_CALLBACK_MOUSE_WHEEL,
_edje_mouse_wheel_cb);
- _edje_text_part_on_del(ed, rp);
- _edje_color_class_on_del(ed, rp);
+ _edje_text_real_part_on_del(ed, rp);
evas_object_del(rp->object);
if (rp->swallowed_object)
{
}
void
-_edje_collection_free(Edje_Part_Collection *ec)
+_edje_collection_free(Edje *ed, Edje_Part_Collection *ec)
{
while (ec->programs)
{
Edje_Program *pr;
-
+
pr = ec->programs->data;
ec->programs = evas_list_remove(ec->programs, pr);
if (pr->name) free(pr->name);
while (ec->parts)
{
Edje_Part *ep;
-
+
ep = ec->parts->data;
ec->parts = evas_list_remove(ec->parts, ep);
+ _edje_text_part_on_del(ed, ep);
+ _edje_color_class_on_del(ed, ep);
if (ep->name) free(ep->name);
- if (ep->default_desc) _edje_collection_free_part_description_free(ep->default_desc);
+ if (ep->default_desc)
+ {
+ _edje_collection_free_part_description_free(ep->default_desc);
+ ep->default_desc = NULL;
+ }
while (ep->other_desc)
{
Edje_Part_Description *desc;
void _edje_file_add(Edje *ed);
void _edje_file_del(Edje *ed);
void _edje_file_free(Edje_File *edf);
-void _edje_collection_free(Edje_Part_Collection *ec);
+void _edje_collection_free(Edje *ed, Edje_Part_Collection *ec);
Edje *_edje_add(Evas_Object *obj);
void _edje_del(Edje *ed);
void _edje_text_init(void);
void _edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep);
void _edje_text_part_on_add_clippers(Edje *ed, Edje_Real_Part *ep);
-void _edje_text_part_on_del(Edje *ed, Edje_Real_Part *ep);
+void _edje_text_part_on_del(Edje *ed, Edje_Part *ep);
+void _edje_text_real_part_on_del(Edje *ed, Edje_Real_Part *ep);
void _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *params, Edje_Part_Description *chosen_desc);
Edje_Real_Part *_edje_real_part_get(Edje *ed, char *part);
Edje_Color_Class *_edje_color_class_find(Edje *ed, char *color_class);
void _edje_color_class_member_add(Edje *ed, char *color_class);
void _edje_color_class_member_del(Edje *ed, char *color_class);
-void _edje_color_class_on_del(Edje *ed, Edje_Real_Part *rp);
+void _edje_color_class_on_del(Edje *ed, Edje_Part *ep);
Edje_Text_Class *_edje_text_class_find(Edje *ed, char *text_class);
void _edje_text_class_member_add(Edje *ed, char *text_class);
void _edje_text_class_member_del(Edje *ed, char *text_class);
}
void
-_edje_text_part_on_del(Edje *ed, Edje_Real_Part *ep)
+_edje_text_part_on_del(Edje *ed, Edje_Part *pt)
{
Evas_List *tmp;
- Edje_Part *pt = ep->part;
- while (ep->extra_objects)
+ if ((pt->default_desc) && (pt->default_desc->text.text_class))
{
- Evas_Object *o;
-
- o = ep->extra_objects->data;
- ep->extra_objects = evas_list_remove(ep->extra_objects, o);
- evas_object_del(o);
+ _edje_text_class_member_del(ed, pt->default_desc->text.text_class);
+ pt->default_desc->text.text_class = NULL;
}
-
- if ((pt->default_desc) && (pt->default_desc->text.text_class)) _edje_text_class_member_del(ed, pt->default_desc->text.text_class);
for (tmp = pt->other_desc; tmp; tmp = tmp->next)
{
Edje_Part_Description *desc;
desc = tmp->data;
- if (desc->text.text_class) _edje_text_class_member_del(ed, desc->text.text_class);
+ if (desc->text.text_class)
+ {
+ _edje_text_class_member_del(ed, desc->text.text_class);
+ desc->text.text_class = NULL;
+ }
+ }
+ return;
+}
+
+void
+_edje_text_real_part_on_del(Edje *ed, Edje_Real_Part *ep)
+{
+ Evas_List *tmp;
+
+ while (ep->extra_objects)
+ {
+ Evas_Object *o;
+
+ o = ep->extra_objects->data;
+ ep->extra_objects = evas_list_remove(ep->extra_objects, o);
+ evas_object_del(o);
}
return;
}
}
void
-_edje_color_class_on_del(Edje *ed, Edje_Real_Part *rp)
+_edje_color_class_on_del(Edje *ed, Edje_Part *ep)
{
Evas_List *tmp;
- Edje_Part *ep = rp->part;
if ((ep->default_desc) && (ep->default_desc->color_class)) _edje_color_class_member_del(ed, ep->default_desc->color_class);
for (tmp = ep->other_desc; tmp; tmp = tmp->next)
Edje_Part_Description *desc;
desc = tmp->data;
- if (desc->color_class) _edje_color_class_member_del(ed, desc->color_class);
+ if (desc->color_class)
+ {
+ _edje_color_class_member_del(ed, desc->color_class);
+ desc->color_class = NULL;
+ }
}
}