summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2014-10-20 10:46:16 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-10-20 10:47:41 +0200
commit7c92d4fa7bb0edd7dc6967deebed0ff4e189361a (patch)
treebe81d29521f9e2da4f9de5440f9eb9e0c3818fcb /src/bin/edje
parent4858776205e31263a709a1d25c9eaac33f8741f6 (diff)
edje: correctly destroy reference to removed part.
NOTE: I do believe their is still the possibility that a wrong program or part may reference a dead part. Would require to check that scenario better later.
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_cc.h1
-rw-r--r--src/bin/edje/edje_cc_handlers.c30
-rwxr-xr-xsrc/bin/edje/edje_cc_out.c19
3 files changed, 35 insertions, 15 deletions
diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h
index 6a6d79f377..7b794ed0ed 100644
--- a/src/bin/edje/edje_cc.h
+++ b/src/bin/edje/edje_cc.h
@@ -174,6 +174,7 @@ void data_queue_part_nest_lookup(Edje_Part_Collection *pc, const char *name,
174void data_queue_copied_part_nest_lookup(Edje_Part_Collection *pc, int *src, int *dest, char **dest2); 174void data_queue_copied_part_nest_lookup(Edje_Part_Collection *pc, int *src, int *dest, char **dest2);
175void data_queue_part_reallocated_lookup(Edje_Part_Collection *pc, const char *name, 175void data_queue_part_reallocated_lookup(Edje_Part_Collection *pc, const char *name,
176 unsigned char **base, int offset); 176 unsigned char **base, int offset);
177void part_lookup_del(Edje_Part_Collection *pc, int *dest);
177void part_lookup_delete(Edje_Part_Collection *pc, const char *name, int *dest, char **dest2); 178void part_lookup_delete(Edje_Part_Collection *pc, const char *name, int *dest, char **dest2);
178void data_queue_copied_part_lookup(Edje_Part_Collection *pc, int *src, int *dest); 179void data_queue_copied_part_lookup(Edje_Part_Collection *pc, int *src, int *dest);
179void *data_queue_program_lookup(Edje_Part_Collection *pc, const char *name, int *dest); 180void *data_queue_program_lookup(Edje_Part_Collection *pc, const char *name, int *dest);
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 451c695c81..845aa53ab2 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -4206,13 +4206,13 @@ _part_desc_free(Edje_Part_Collection *pc,
4206{ 4206{
4207 if (!ed) return NULL; 4207 if (!ed) return NULL;
4208 4208
4209 part_lookup_delete(pc, ep->name, &(ed->rel1.id_x), NULL); 4209 part_lookup_del(pc, &(ed->rel1.id_x));
4210 part_lookup_delete(pc, ep->name, &(ed->rel1.id_y), NULL); 4210 part_lookup_del(pc, &(ed->rel1.id_y));
4211 part_lookup_delete(pc, ep->name, &(ed->rel2.id_x), NULL); 4211 part_lookup_del(pc, &(ed->rel2.id_x));
4212 part_lookup_delete(pc, ep->name, &(ed->rel2.id_y), NULL); 4212 part_lookup_del(pc, &(ed->rel2.id_y));
4213 part_lookup_delete(pc, ep->name, &(ed->map.id_persp), NULL); 4213 part_lookup_del(pc, &(ed->map.id_persp));
4214 part_lookup_delete(pc, ep->name, &(ed->map.id_light), NULL); 4214 part_lookup_del(pc, &(ed->map.id_light));
4215 part_lookup_delete(pc, ep->name, &(ed->map.rot.id_center), NULL); 4215 part_lookup_del(pc, &(ed->map.rot.id_center));
4216 4216
4217 switch (ep->type) 4217 switch (ep->type)
4218 { 4218 {
@@ -4230,17 +4230,17 @@ _part_desc_free(Edje_Part_Collection *pc,
4230 case EDJE_PART_TYPE_TEXT: 4230 case EDJE_PART_TYPE_TEXT:
4231 case EDJE_PART_TYPE_TEXTBLOCK: 4231 case EDJE_PART_TYPE_TEXTBLOCK:
4232 { 4232 {
4233 /* Edje_Part_Description_Text *ted = (Edje_Part_Description_Text*) ed; */ 4233 Edje_Part_Description_Text *ted = (Edje_Part_Description_Text*) ed;
4234 4234
4235 /* part_lookup_delete(pc, ep->name, &(ted->text.id_source_part)); */ 4235 part_lookup_del(pc, &(ted->text.id_source));
4236 /* part_lookup_delete(pc, ep->name, &(ted->text.id_text_source_part)); */ 4236 part_lookup_del(pc, &(ted->text.id_text_source));
4237 break; 4237 break;
4238 } 4238 }
4239 case EDJE_PART_TYPE_PROXY: 4239 case EDJE_PART_TYPE_PROXY:
4240 { 4240 {
4241 Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed; 4241 Edje_Part_Description_Proxy *ped = (Edje_Part_Description_Proxy*) ed;
4242 4242
4243 part_lookup_delete(pc, ep->name, &(ped->proxy.id), NULL); 4243 part_lookup_del(pc, &(ped->proxy.id));
4244 break; 4244 break;
4245 } 4245 }
4246 } 4246 }
@@ -4256,10 +4256,10 @@ _part_free(Edje_Part_Collection *pc, Edje_Part *ep)
4256 Edje_Part_Parser *epp = (Edje_Part_Parser*)ep; 4256 Edje_Part_Parser *epp = (Edje_Part_Parser*)ep;
4257 unsigned int j; 4257 unsigned int j;
4258 4258
4259 part_lookup_delete(pc, ep->name, &(ep->clip_to_id), NULL); 4259 part_lookup_del(pc, &(ep->clip_to_id));
4260 part_lookup_delete(pc, ep->name, &(ep->dragable.confine_id), NULL); 4260 part_lookup_del(pc, &(ep->dragable.confine_id));
4261 part_lookup_delete(pc, ep->name, &(ep->dragable.threshold_id), NULL); 4261 part_lookup_del(pc, &(ep->dragable.threshold_id));
4262 part_lookup_delete(pc, ep->name, &(ep->dragable.event_id), NULL); 4262 part_lookup_del(pc, &(ep->dragable.event_id));
4263 4263
4264 _part_desc_free(pc, ep, ep->default_desc); 4264 _part_desc_free(pc, ep, ep->default_desc);
4265 for (j = 0 ; j < ep->other.desc_count ; j++) 4265 for (j = 0 ; j < ep->other.desc_count ; j++)
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index 83a341b2a6..d503663eed 100755
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -2268,6 +2268,25 @@ data_queue_part_reallocated_lookup(Edje_Part_Collection *pc, const char *name,
2268} 2268}
2269 2269
2270void 2270void
2271part_lookup_del(Edje_Part_Collection *pc, int *dest)
2272{
2273 Part_Lookup_Key key;
2274 Part_Lookup *pl = NULL;
2275 Eina_List *list;
2276 key.pc = pc;
2277 key.mem.dest = dest;
2278 key.stable = EINA_TRUE;
2279
2280 pl = eina_hash_find(part_pc_dest_lookup, &key);
2281 if (!pl) return;
2282 list = eina_hash_find(part_dest_lookup, &pl->key);
2283 if (list)
2284 eina_hash_del(part_dest_lookup, &pl->key, list);
2285 eina_hash_del(part_pc_dest_lookup, &key, pl);
2286}
2287
2288
2289void
2271part_lookup_delete(Edje_Part_Collection *pc, const char *name, int *dest, char **dest2) 2290part_lookup_delete(Edje_Part_Collection *pc, const char *name, int *dest, char **dest2)
2272{ 2291{
2273 Part_Lookup_Key key; 2292 Part_Lookup_Key key;