summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-05-10 15:46:55 -0700
committerCedric Bail <cedric@osg.samsung.com>2016-05-10 16:36:22 -0700
commit5bb39ed43da5916ce18a743f7afd361e0d86b138 (patch)
tree030e74b0a10fdf570537a59aea8997c82ee718cf
parent0413c26f82fb5a9ffcbd02158536e7c39a34d22e (diff)
edje_cc: cleanup queued jobs for removed program
Summary: When a new edje program is created, some jobs like lookup part (Part_Lookup) or compiling embryo script (Code_Program) are queued. If program is removed, queued jobs should be removed also. Reviewers: jpeg, cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D3900 Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
-rw-r--r--src/bin/edje/edje_cc_handlers.c10
-rw-r--r--src/bin/edje/edje_cc_out.c19
2 files changed, 28 insertions, 1 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index a5e43a765e..f0ac0569a3 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -1814,6 +1814,8 @@ _edje_program_check(const char *name, Edje_Program *me, Edje_Program **pgrms, un
1814 { 1814 {
1815 _edje_program_remove(pc, me); 1815 _edje_program_remove(pc, me);
1816 current_program = pgrms[i]; 1816 current_program = pgrms[i];
1817 if (pgrms[i]->action == EDJE_ACTION_TYPE_SCRIPT)
1818 copied_program_anonymous_lookup_delete(pc, &pgrms[i]->id);
1817 epp->can_override = EINA_FALSE; 1819 epp->can_override = EINA_FALSE;
1818 return; 1820 return;
1819 } 1821 }
@@ -5744,9 +5746,12 @@ st_collections_group_parts_part_inherit(void)
5744static void 5746static void
5745_program_free(Edje_Program *pr) 5747_program_free(Edje_Program *pr)
5746{ 5748{
5749 Edje_Part_Collection *pc;
5747 Edje_Program_Target *prt; 5750 Edje_Program_Target *prt;
5748 Edje_Program_After *pa; 5751 Edje_Program_After *pa;
5749 5752
5753 pc = eina_list_last_data_get(edje_collections);
5754
5750 free((void*)pr->name); 5755 free((void*)pr->name);
5751 free((void*)pr->signal); 5756 free((void*)pr->signal);
5752 free((void*)pr->source); 5757 free((void*)pr->source);
@@ -5757,7 +5762,10 @@ _program_free(Edje_Program *pr)
5757 free((void*)pr->sample_name); 5762 free((void*)pr->sample_name);
5758 free((void*)pr->tone_name); 5763 free((void*)pr->tone_name);
5759 EINA_LIST_FREE(pr->targets, prt) 5764 EINA_LIST_FREE(pr->targets, prt)
5760 free(prt); 5765 {
5766 part_lookup_del(pc, &prt->id);
5767 free(prt);
5768 }
5761 EINA_LIST_FREE(pr->after, pa) 5769 EINA_LIST_FREE(pr->after, pa)
5762 free(pa); 5770 free(pa);
5763 free(pr); 5771 free(pr);
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index 3bdfe7efda..17fc0240e0 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -2945,6 +2945,25 @@ copied_program_anonymous_lookup_delete(Edje_Part_Collection *pc, int *dest)
2945 { 2945 {
2946 if ((!pl->anonymous) || (pl->pc != pc) || (dest != &pl->u.ep->id)) continue; 2946 if ((!pl->anonymous) || (pl->pc != pc) || (dest != &pl->u.ep->id)) continue;
2947 program_lookups = eina_list_remove_list(program_lookups, l); 2947 program_lookups = eina_list_remove_list(program_lookups, l);
2948
2949 Code *cd;
2950 Code_Program *cp;
2951 Edje_Part_Collection_Directory_Entry *de;
2952 Eina_List *l, *ll;
2953
2954 de = eina_hash_find(edje_file->collection, pl->pc->part);
2955 cd = eina_list_nth(codes, de->id);
2956
2957 EINA_LIST_FOREACH_SAFE(cd->programs, l, ll, cp)
2958 {
2959 if (pl->dest == &cp->id)
2960 {
2961 cd->programs = eina_list_remove(cd->programs, cp);
2962 free(cp);
2963 break;
2964 }
2965 }
2966
2948 free(pl); 2967 free(pl);
2949 } 2968 }
2950} 2969}