summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--NEWS2
-rw-r--r--src/lib/edje/edje_calc.c46
3 files changed, 28 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index ba374ef462..3b937615d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-10-15 ChunEon Park (Hermet)
2
3 * Fixed memory leak in the edje map color transition.
4
12013-10-11 Carsten Haitzler (The Rasterman) 52013-10-11 Carsten Haitzler (The Rasterman)
2 6
3 * deprecate/remove all the eina_error setting (and getting) 7 * deprecate/remove all the eina_error setting (and getting)
diff --git a/NEWS b/NEWS
index 210b8f55dd..9693b0d989 100644
--- a/NEWS
+++ b/NEWS
@@ -428,6 +428,8 @@ Fixes:
428 - Correctly set match flag of signal callbacks 428 - Correctly set match flag of signal callbacks
429 - Fix size calculation of flags of signal callbacks 429 - Fix size calculation of flags of signal callbacks
430 - Check for both Lua 5.1 and 5.2. 430 - Check for both Lua 5.1 and 5.2.
431 - Fixed memory leak in the edje map color transition.
432
431 * Efreet: 433 * Efreet:
432 - Fix desktop command parsing of https. 434 - Fix desktop command parsing of https.
433 * Emotion: 435 * Emotion:
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 4ef7f48b9f..71eb95dfae 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -2873,9 +2873,20 @@ _edje_physics_body_add(Edje *ed, Edje_Real_Part *rp, EPhysics_World *world)
2873 2873
2874#define INTP(_x1, _x2, _p) TO_INT(FINTP(_x1, _x2, _p)) 2874#define INTP(_x1, _x2, _p) TO_INT(FINTP(_x1, _x2, _p))
2875 2875
2876static void
2877_map_colors_free(Edje_Calc_Params *pf)
2878{
2879 Edje_Map_Color **colors = pf->map->colors;
2880 int i;
2881
2882 for (i = 0; i < (int) pf->map->colors_count; i++)
2883 free(colors[i]);
2884 free (colors);
2885}
2886
2876static Eina_Bool 2887static Eina_Bool
2877map_colors_interp(Edje_Calc_Params *p1, Edje_Calc_Params *p2, 2888_map_colors_interp(Edje_Calc_Params *p1, Edje_Calc_Params *p2,
2878 Edje_Calc_Params_Map *pmap, FLOAT_T pos) 2889 Edje_Calc_Params_Map *pmap, FLOAT_T pos)
2879{ 2890{
2880 Edje_Map_Color *col, *col2, *col3; 2891 Edje_Map_Color *col, *col2, *col3;
2881 int i, j, idx = 0; 2892 int i, j, idx = 0;
@@ -2949,8 +2960,7 @@ map_colors_interp(Edje_Calc_Params *p1, Edje_Calc_Params *p2,
2949static void 2960static void
2950_edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf, 2961_edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf,
2951 Edje_Part_Description_Common *chosen_desc, 2962 Edje_Part_Description_Common *chosen_desc,
2952 Edje_Real_Part *ep, Evas_Object *mo, 2963 Edje_Real_Part *ep, Evas_Object *mo)
2953 Eina_Bool map_colors_free)
2954{ 2964{
2955 Edje_Map_Color **colors = pf->map->colors; 2965 Edje_Map_Color **colors = pf->map->colors;
2956 int colors_cnt = pf->map->colors_count; 2966 int colors_cnt = pf->map->colors_count;
@@ -2985,25 +2995,11 @@ _edje_map_prop_set(Evas_Map *map, const Edje_Calc_Params *pf,
2985 } 2995 }
2986 else 2996 else
2987 { 2997 {
2988 if (map_colors_free) 2998 for (i = 0; i < colors_cnt; i++)
2989 { 2999 {
2990 for (i = 0; i < colors_cnt; i++) 3000 color = colors[i];
2991 { 3001 evas_map_point_color_set(map, color->idx, color->r, color->g,
2992 color = colors[i]; 3002 color->b, color->a);
2993 evas_map_point_color_set(map, color->idx, color->r, color->g,
2994 color->b, color->a);
2995 free(colors[i]);
2996 }
2997 free (colors);
2998 }
2999 else
3000 {
3001 for (i = 0; i < colors_cnt; i++)
3002 {
3003 color = colors[i];
3004 evas_map_point_color_set(map, color->idx, color->r, color->g,
3005 color->b, color->a);
3006 }
3007 } 3003 }
3008 } 3004 }
3009 3005
@@ -3604,7 +3600,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
3604 3600
3605#define MIX(P1, P2, P3, pos, info) \ 3601#define MIX(P1, P2, P3, pos, info) \
3606 P3->info = P1->map->info + TO_INT(SCALE(pos, P2->map->info - P1->map->info)); 3602 P3->info = P1->map->info + TO_INT(SCALE(pos, P2->map->info - P1->map->info));
3607 map_colors_free = map_colors_interp(p1, p2, p3_write, pos); 3603 map_colors_free = _map_colors_interp(p1, p2, p3_write, pos);
3608 3604
3609 if (p1->lighted && p2->lighted) 3605 if (p1->lighted && p2->lighted)
3610 { 3606 {
@@ -3906,7 +3902,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
3906 // create map and populate with part geometry 3902 // create map and populate with part geometry
3907 if (!map) map = evas_map_new(4); 3903 if (!map) map = evas_map_new(4);
3908 3904
3909 _edje_map_prop_set(map, pf, chosen_desc, ep, mo, map_colors_free); 3905 _edje_map_prop_set(map, pf, chosen_desc, ep, mo);
3910 3906
3911 if (ep->nested_smart) 3907 if (ep->nested_smart)
3912 { /* Apply map to smart obj holding nested parts */ 3908 { /* Apply map to smart obj holding nested parts */
@@ -3947,6 +3943,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
3947 } 3943 }
3948 } 3944 }
3949 3945
3946 if (map_colors_free) _map_colors_free(pf);
3947
3950#ifdef HAVE_EPHYSICS 3948#ifdef HAVE_EPHYSICS
3951 ep->prev_description = chosen_desc; 3949 ep->prev_description = chosen_desc;
3952 if (!ep->body) 3950 if (!ep->body)