summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-04-01 17:37:37 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-04-01 17:54:37 +0900
commitb132ce65ec755e282291f4fa8da46eafcc2af942 (patch)
tree174e41d9d46e2282709a142e3c73ed95553ae99a /src/lib
parente438bd09b2642308112b31b8349235f0b850cb9c (diff)
evas - fix leak because cutouts_fre .. doesnt free - it just resets to 0
this works with 7166e6b85994b19a29f05c9e2b6d75a314a3cb91 and fixes a leak added because ... free does not free! evas_common_draw_context_cutouts_real_free(0 now actually frees the rects, but evas_common_draw_context_cutouts_free() before did not. @fix (follow on from 7166e6b85994b19a29f05c9e2b6d75a314a3cb91)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/evas/common/evas_draw.h1
-rw-r--r--src/lib/evas/common/evas_draw_main.c8
-rw-r--r--src/lib/evas/common/evas_font_draw.c5
-rw-r--r--src/lib/evas/common/evas_map_image.c10
-rw-r--r--src/lib/evas/common/evas_rectangle_main.c5
-rw-r--r--src/lib/evas/common/evas_scale_main.c5
6 files changed, 24 insertions, 10 deletions
diff --git a/src/lib/evas/common/evas_draw.h b/src/lib/evas/common/evas_draw.h
index 0beb84cf79..0623ea4662 100644
--- a/src/lib/evas/common/evas_draw.h
+++ b/src/lib/evas/common/evas_draw.h
@@ -23,6 +23,7 @@ EAPI void evas_common_draw_context_set_multiplier (RGBA_D
23EAPI void evas_common_draw_context_unset_multiplier (RGBA_Draw_Context *dc); 23EAPI void evas_common_draw_context_unset_multiplier (RGBA_Draw_Context *dc);
24EAPI Cutout_Rects *evas_common_draw_context_cutouts_new (void); 24EAPI Cutout_Rects *evas_common_draw_context_cutouts_new (void);
25EAPI void evas_common_draw_context_cutouts_free (Cutout_Rects* rects); 25EAPI void evas_common_draw_context_cutouts_free (Cutout_Rects* rects);
26EAPI void evas_common_draw_context_cutouts_real_free (Cutout_Rects* rects);
26EAPI void evas_common_draw_context_cutouts_del (Cutout_Rects* rects, int idx); 27EAPI void evas_common_draw_context_cutouts_del (Cutout_Rects* rects, int idx);
27EAPI void evas_common_draw_context_add_cutout (RGBA_Draw_Context *dc, int x, int y, int w, int h); 28EAPI void evas_common_draw_context_add_cutout (RGBA_Draw_Context *dc, int x, int y, int w, int h);
28EAPI void evas_common_draw_context_clear_cutouts (RGBA_Draw_Context *dc); 29EAPI void evas_common_draw_context_clear_cutouts (RGBA_Draw_Context *dc);
diff --git a/src/lib/evas/common/evas_draw_main.c b/src/lib/evas/common/evas_draw_main.c
index 460a2967d1..289d6dfdb4 100644
--- a/src/lib/evas/common/evas_draw_main.c
+++ b/src/lib/evas/common/evas_draw_main.c
@@ -36,6 +36,14 @@ evas_common_draw_context_cutouts_free(Cutout_Rects* rects)
36} 36}
37 37
38EAPI void 38EAPI void
39evas_common_draw_context_cutouts_real_free(Cutout_Rects* rects)
40{
41 if (!rects) return;
42 free(rects->rects);
43 free(rects);
44}
45
46EAPI void
39evas_common_draw_context_cutouts_del(Cutout_Rects* rects, int idx) 47evas_common_draw_context_cutouts_del(Cutout_Rects* rects, int idx)
40{ 48{
41 if ((idx >= 0) && (idx < rects->active)) 49 if ((idx >= 0) && (idx < rects->active))
diff --git a/src/lib/evas/common/evas_font_draw.c b/src/lib/evas/common/evas_font_draw.c
index c61e92190c..79c8900c34 100644
--- a/src/lib/evas/common/evas_font_draw.c
+++ b/src/lib/evas/common/evas_font_draw.c
@@ -421,11 +421,12 @@ evas_common_font_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, E
421 rects_used++; 421 rects_used++;
422 if (rects_used >= 4096) 422 if (rects_used >= 4096)
423 { 423 {
424 evas_common_draw_context_cutouts_free(rects); 424 evas_common_draw_context_cutouts_real_free(rects);
425 rects = NULL; 425 rects = NULL;
426 rects_used = 0;
426 } 427 }
427#else 428#else
428 evas_common_draw_context_cutouts_free(rects); 429 evas_common_draw_context_cutouts_real_free(rects);
429#endif 430#endif
430 } 431 }
431 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch; 432 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
diff --git a/src/lib/evas/common/evas_map_image.c b/src/lib/evas/common/evas_map_image.c
index f5b1a32101..252bd3ba58 100644
--- a/src/lib/evas/common/evas_map_image.c
+++ b/src/lib/evas/common/evas_map_image.c
@@ -793,11 +793,12 @@ evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
793 rects_used++; 793 rects_used++;
794 if (rects_used >= 4096) 794 if (rects_used >= 4096)
795 { 795 {
796 evas_common_draw_context_cutouts_free(rects); 796 evas_common_draw_context_cutouts_real_free(rects);
797 rects = NULL; 797 rects = NULL;
798 rects_used = 0;
798 } 799 }
799#else 800#else
800 evas_common_draw_context_cutouts_free(rects); 801 evas_common_draw_context_cutouts_real_free(rects);
801#endif 802#endif
802 /* restore clip info */ 803 /* restore clip info */
803 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch; 804 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
@@ -857,11 +858,12 @@ evas_common_map_thread_rgba_cb(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Conte
857 rects_used++; 858 rects_used++;
858 if (rects_used >= 4096) 859 if (rects_used >= 4096)
859 { 860 {
860 evas_common_draw_context_cutouts_free(rects); 861 evas_common_draw_context_cutouts_real_free(rects);
861 rects = NULL; 862 rects = NULL;
863 rects_used = 0;
862 } 864 }
863#else 865#else
864 evas_common_draw_context_cutouts_free(rects); 866 evas_common_draw_context_cutouts_real_free(rects);
865#endif 867#endif
866 /* restore clip info */ 868 /* restore clip info */
867 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch; 869 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
diff --git a/src/lib/evas/common/evas_rectangle_main.c b/src/lib/evas/common/evas_rectangle_main.c
index 388fba663a..ed78cca58e 100644
--- a/src/lib/evas/common/evas_rectangle_main.c
+++ b/src/lib/evas/common/evas_rectangle_main.c
@@ -51,11 +51,12 @@ evas_common_rectangle_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int
51 rects_used++; 51 rects_used++;
52 if (rects_used >= 4096) 52 if (rects_used >= 4096)
53 { 53 {
54 evas_common_draw_context_cutouts_free(rects); 54 evas_common_draw_context_cutouts_real_free(rects);
55 rects = NULL; 55 rects = NULL;
56 rects_used = 0;
56 } 57 }
57#else 58#else
58 evas_common_draw_context_cutouts_free(rects); 59 evas_common_draw_context_cutouts_real_free(rects);
59#endif 60#endif
60 } 61 }
61 } 62 }
diff --git a/src/lib/evas/common/evas_scale_main.c b/src/lib/evas/common/evas_scale_main.c
index 6c8a262588..a09f0c6805 100644
--- a/src/lib/evas/common/evas_scale_main.c
+++ b/src/lib/evas/common/evas_scale_main.c
@@ -89,11 +89,12 @@ evas_common_scale_rgba_in_to_out_clip_cb(RGBA_Image *src, RGBA_Image *dst,
89 rects_used++; 89 rects_used++;
90 if (rects_used >= 4096) 90 if (rects_used >= 4096)
91 { 91 {
92 evas_common_draw_context_cutouts_free(rects); 92 evas_common_draw_context_cutouts_real_free(rects);
93 rects = NULL; 93 rects = NULL;
94 rects_used = 0;
94 } 95 }
95#else 96#else
96 evas_common_draw_context_cutouts_free(rects); 97 evas_common_draw_context_cutouts_real_free(rects);
97#endif 98#endif
98 /* restore clip info */ 99 /* restore clip info */
99 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch; 100 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;