summaryrefslogtreecommitdiff
path: root/legacy/edje/src/lib/edje_text.c
diff options
context:
space:
mode:
authorrbdpngn <rbdpngn>2003-11-25 07:22:19 +0000
committerrbdpngn <rbdpngn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2003-11-25 07:22:19 +0000
commit6bee6d788d1089d2d3cbb75f42e16e69f240a947 (patch)
tree4187c369aba8c4cf8a33f480efcc9f67d2b4f6dc /legacy/edje/src/lib/edje_text.c
parent6dd589c4c4aebaaf1a2c1794893ad033fd19eba4 (diff)
Avoid memory corruption by cleaning up parts at the correct time.
SVN revision: 7942
Diffstat (limited to 'legacy/edje/src/lib/edje_text.c')
-rw-r--r--legacy/edje/src/lib/edje_text.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c
index 43acb54..903214f 100644
--- a/legacy/edje/src/lib/edje_text.c
+++ b/legacy/edje/src/lib/edje_text.c
@@ -229,27 +229,41 @@ _edje_text_part_on_add_clippers(Edje *ed, Edje_Real_Part *ep)
229} 229}
230 230
231void 231void
232_edje_text_part_on_del(Edje *ed, Edje_Real_Part *ep) 232_edje_text_part_on_del(Edje *ed, Edje_Part *pt)
233{ 233{
234 Evas_List *tmp; 234 Evas_List *tmp;
235 Edje_Part *pt = ep->part;
236 235
237 while (ep->extra_objects) 236 if ((pt->default_desc) && (pt->default_desc->text.text_class))
238 { 237 {
239 Evas_Object *o; 238 _edje_text_class_member_del(ed, pt->default_desc->text.text_class);
240 239 pt->default_desc->text.text_class = NULL;
241 o = ep->extra_objects->data;
242 ep->extra_objects = evas_list_remove(ep->extra_objects, o);
243 evas_object_del(o);
244 } 240 }
245
246 if ((pt->default_desc) && (pt->default_desc->text.text_class)) _edje_text_class_member_del(ed, pt->default_desc->text.text_class);
247 for (tmp = pt->other_desc; tmp; tmp = tmp->next) 241 for (tmp = pt->other_desc; tmp; tmp = tmp->next)
248 { 242 {
249 Edje_Part_Description *desc; 243 Edje_Part_Description *desc;
250 244
251 desc = tmp->data; 245 desc = tmp->data;
252 if (desc->text.text_class) _edje_text_class_member_del(ed, desc->text.text_class); 246 if (desc->text.text_class)
247 {
248 _edje_text_class_member_del(ed, desc->text.text_class);
249 desc->text.text_class = NULL;
250 }
251 }
252 return;
253}
254
255void
256_edje_text_real_part_on_del(Edje *ed, Edje_Real_Part *ep)
257{
258 Evas_List *tmp;
259
260 while (ep->extra_objects)
261 {
262 Evas_Object *o;
263
264 o = ep->extra_objects->data;
265 ep->extra_objects = evas_list_remove(ep->extra_objects, o);
266 evas_object_del(o);
253 } 267 }
254 return; 268 return;
255} 269}