summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2014-10-20 01:27:27 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-10-20 01:28:12 +0200
commit955fd1d712c3415c3ad170cdffac88a448d9441e (patch)
tree84ee285c52aa9d14d2147726e19ffc8eacc3aab4 /src/bin/edje
parent9d69033411280a85602b4386238159a9cfa7b8a6 (diff)
edje: destroy left over reference when removing a part.
NOTE: This patch is still not complete, their is more reference, but I couldn't find all of them yet.
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_cc_handlers.c70
1 files changed, 59 insertions, 11 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index a7a210c7ff..451c695c81 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -4200,20 +4200,75 @@ ob_collections_group_parts_part(void)
4200} 4200}
4201 4201
4202static void * 4202static void *
4203_part_desc_free(Edje_Part_Description_Common *ed) 4203_part_desc_free(Edje_Part_Collection *pc,
4204 Edje_Part *ep,
4205 Edje_Part_Description_Common *ed)
4204{ 4206{
4205 if (!ed) return NULL; 4207 if (!ed) return NULL;
4208
4209 part_lookup_delete(pc, ep->name, &(ed->rel1.id_x), NULL);
4210 part_lookup_delete(pc, ep->name, &(ed->rel1.id_y), NULL);
4211 part_lookup_delete(pc, ep->name, &(ed->rel2.id_x), NULL);
4212 part_lookup_delete(pc, ep->name, &(ed->rel2.id_y), NULL);
4213 part_lookup_delete(pc, ep->name, &(ed->map.id_persp), NULL);
4214 part_lookup_delete(pc, ep->name, &(ed->map.id_light), NULL);
4215 part_lookup_delete(pc, ep->name, &(ed->map.rot.id_center), NULL);
4216
4217 switch (ep->type)
4218 {
4219 case EDJE_PART_TYPE_SPACER:
4220 case EDJE_PART_TYPE_RECTANGLE:
4221 case EDJE_PART_TYPE_SWALLOW:
4222 case EDJE_PART_TYPE_GROUP:
4223 /* Nothing todo, this part only have a common description. */
4224 break;
4225 case EDJE_PART_TYPE_BOX:
4226 case EDJE_PART_TYPE_TABLE:
4227 case EDJE_PART_TYPE_IMAGE:
4228 /* Nothing todo here */
4229 break;
4230 case EDJE_PART_TYPE_TEXT:
4231 case EDJE_PART_TYPE_TEXTBLOCK:
4232 {
4233 /* Edje_Part_Description_Text *ted = (Edje_Part_Description_Text*) ed; */
4234
4235 /* part_lookup_delete(pc, ep->name, &(ted->text.id_source_part)); */
4236 /* part_lookup_delete(pc, ep->name, &(ted->text.id_text_source_part)); */
4237 break;
4238 }
4239 case EDJE_PART_TYPE_PROXY:
4240 {
4241 Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed;
4242
4243 part_lookup_delete(pc, ep->name, &(ped->proxy.id), NULL);
4244 break;
4245 }
4246 }
4247
4206 free((void*)ed->state.name); 4248 free((void*)ed->state.name);
4207 free(ed); 4249 free(ed);
4208 return NULL; 4250 return NULL;
4209} 4251}
4210 4252
4211static void * 4253static void *
4212_part_free(Edje_Part *ep) 4254_part_free(Edje_Part_Collection *pc, Edje_Part *ep)
4213{ 4255{
4214 Edje_Part_Parser *epp = (Edje_Part_Parser*)ep; 4256 Edje_Part_Parser *epp = (Edje_Part_Parser*)ep;
4215 unsigned int j; 4257 unsigned int j;
4216 4258
4259 part_lookup_delete(pc, ep->name, &(ep->clip_to_id), NULL);
4260 part_lookup_delete(pc, ep->name, &(ep->dragable.confine_id), NULL);
4261 part_lookup_delete(pc, ep->name, &(ep->dragable.threshold_id), NULL);
4262 part_lookup_delete(pc, ep->name, &(ep->dragable.event_id), NULL);
4263
4264 _part_desc_free(pc, ep, ep->default_desc);
4265 for (j = 0 ; j < ep->other.desc_count ; j++)
4266 _part_desc_free(pc, ep, ep->other.desc[j]);
4267
4268 for (j = 0 ; j < ep->items_count ; j++)
4269 free(ep->items[j]);
4270 free(ep->items);
4271
4217 free((void*)ep->name); 4272 free((void*)ep->name);
4218 free((void*)ep->source); 4273 free((void*)ep->source);
4219 free((void*)ep->source2); 4274 free((void*)ep->source2);
@@ -4225,16 +4280,9 @@ _part_free(Edje_Part *ep)
4225 free((void*)epp->reorder.insert_before); 4280 free((void*)epp->reorder.insert_before);
4226 free((void*)epp->reorder.insert_after); 4281 free((void*)epp->reorder.insert_after);
4227 4282
4228 for (j = 0 ; j < ep->items_count ; j++)
4229 free(ep->items[j]);
4230 free(ep->items);
4231
4232 free((void*)ep->api.name); 4283 free((void*)ep->api.name);
4233 free((void*)ep->api.description); 4284 free((void*)ep->api.description);
4234 4285
4235 _part_desc_free(ep->default_desc);
4236 for (j = 0 ; j < ep->other.desc_count ; j++)
4237 _part_desc_free(ep->other.desc[j]);
4238 free(ep->other.desc); 4286 free(ep->other.desc);
4239 free(ep); 4287 free(ep);
4240 return NULL; 4288 return NULL;
@@ -4278,7 +4326,7 @@ st_collections_group_parts_part_inherit(void)
4278 } 4326 }
4279 pname = current_part->name; 4327 pname = current_part->name;
4280 current_part->name = NULL; 4328 current_part->name = NULL;
4281 current_part = _part_free(current_part); 4329 current_part = _part_free(pc, current_part);
4282 edje_cc_handlers_part_make(id); 4330 edje_cc_handlers_part_make(id);
4283 _part_copy(current_part, pc->parts[i]); 4331 _part_copy(current_part, pc->parts[i]);
4284 free((void*)current_part->name); 4332 free((void*)current_part->name);
@@ -4472,7 +4520,7 @@ st_collections_group_part_remove(void)
4472 4520
4473 if (strcmp(pc->parts[j]->name, name)) continue; 4521 if (strcmp(pc->parts[j]->name, name)) continue;
4474 4522
4475 pc->parts[j] = _part_free(pc->parts[j]); 4523 pc->parts[j] = _part_free(pc, pc->parts[j]);
4476 for (i = j; i < pc->parts_count - 1; i++) 4524 for (i = j; i < pc->parts_count - 1; i++)
4477 { 4525 {
4478 if (!pc->parts[i + 1]) break; 4526 if (!pc->parts[i + 1]) break;