From: seoz Date: Wed, 5 Oct 2011 06:37:06 +0000 (+0000) Subject: edje edje_cc_handlers.c: Fixed edje_cc bugs about data.item. Patch by Jaehwan Kim... X-Git-Tag: submit/trunk/20120815.180907~486 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7baed4f04e9e72adf94541f45a5f358bbcc4d6c8;p=profile%2Fivi%2Fedje.git edje edje_cc_handlers.c: Fixed edje_cc bugs about data.item. Patch by Jaehwan Kim 2011/9/30 Jaehwan Kim : > > I found some bugs in edje_cc_handlers.c. > > One is about data.item. It is saved in hash list. > When it is saved, I freed the memory of the key. > But the memory is used. so I deleted the free(key). > > Second is it is possible in st_collections_group_parts_part_description_state. > So I changed the location of the conditional statement. > > Please apply this patch :) > > Jaehwan Kim. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@63822 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/bin/edje_cc_handlers.c b/src/bin/edje_cc_handlers.c index 9191190..e4a72f1 100644 --- a/src/bin/edje_cc_handlers.c +++ b/src/bin/edje_cc_handlers.c @@ -2023,7 +2023,6 @@ st_collections_group_inherit(void) es = mem_alloc(SZ(Edje_String)); es = (Edje_String *)eina_hash_find(pc2->data, key); eina_hash_direct_add(pc->data, key, es); - free(key); } } @@ -4206,19 +4205,19 @@ st_collections_group_parts_part_description_state(void) sizeof (Edje_Part_Description_Common*) * ep->other.desc_count); current_desc = ep->default_desc; } - } - if (ep->other.desc_count) - { - unsigned int i; - for (i = 0; i < ep->other.desc_count - 1; ++i) + else if (ep->other.desc_count) { - if (!strcmp(s, ep->other.desc[i]->state.name) && ed->state.value == ep->other.desc[i]->state.value) + unsigned int i; + for (i = 0; i < ep->other.desc_count - 1; ++i) { - free(ed); - ep->other.desc_count--; - ep->other.desc = realloc(ep->other.desc, - sizeof (Edje_Part_Description_Common*) * ep->other.desc_count); - current_desc = ep->other.desc[i]; + if (!strcmp(s, ep->other.desc[i]->state.name) && ed->state.value == ep->other.desc[i]->state.value) + { + free(ed); + ep->other.desc_count--; + ep->other.desc = realloc(ep->other.desc, + sizeof (Edje_Part_Description_Common*) * ep->other.desc_count); + current_desc = ep->other.desc[i]; + } } } }