summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-07-04 10:21:06 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-07-04 10:21:06 +0000
commit2e0fd1d375ee62ca0dead9b15462c570473c5857 (patch)
tree141eaf4beb2e67c4d9fc36ac319dd8acd55ee8b2 /legacy/evas/src/lib/engines
parent1d415b796bf0f506ef7888195faa8ec0ed1f0d06 (diff)
evas: make the code do what we expect by destroying Glyph at the right time.
This fix the leak issue that was added lately and make the code more easy to follow. SVN revision: 73265
Diffstat (limited to 'legacy/evas/src/lib/engines')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_load.c27
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_main.c25
2 files changed, 24 insertions, 28 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_font_load.c b/legacy/evas/src/lib/engines/common/evas_font_load.c
index 4024565760..42628be7ed 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_load.c
+++ b/legacy/evas/src/lib/engines/common/evas_font_load.c
@@ -749,33 +749,6 @@ _evas_common_font_int_clear(RGBA_Font_Int *fi)
749 { 749 {
750 if (fi->fash) 750 if (fi->fash)
751 { 751 {
752 for (k = 0; k <= 0xff; k++) // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
753 {
754 Fash_Glyph_Map2 *fmap2 = fi->fash->bucket[k];
755 if (fmap2)
756 {
757 for (j = 0; j <= 0xff; j++) // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
758 {
759 Fash_Glyph_Map *fmap = fmap2->bucket[j];
760 if (fmap)
761 {
762 for (i = 0; i <= 0xff; i++)
763 {
764 RGBA_Font_Glyph *fg = fmap->item[i];
765 if ((fg) && (fg != (void *)(-1)))
766 {
767 FT_Done_Glyph(fg->glyph);
768 /* extension calls */
769 if (fg->ext_dat_free) fg->ext_dat_free(fg->ext_dat);
770 if (fg->glyph_out_free) fg->glyph_out_free(fg->glyph_out);
771 free(fg);
772 fmap->item[i] = NULL;
773 }
774 }
775 }
776 }
777 }
778 }
779 fi->fash->freeme(fi->fash); 752 fi->fash->freeme(fi->fash);
780 fi->fash = NULL; 753 fi->fash = NULL;
781 } 754 }
diff --git a/legacy/evas/src/lib/engines/common/evas_font_main.c b/legacy/evas/src/lib/engines/common/evas_font_main.c
index 100f3b7523..e51a935bff 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_font_main.c
@@ -296,11 +296,33 @@ _fash_int_add(Fash_Int *fash, int item, RGBA_Font_Int *fint, int idx)
296} 296}
297 297
298static void 298static void
299_fash_glyph_free(Fash_Glyph_Map *fmap)
300{
301 int i;
302
303 for (i = 0; i <= 0xff; i++)
304 {
305 RGBA_Font_Glyph *fg = fmap->item[i];
306 if ((fg) && (fg != (void *)(-1)))
307 {
308 FT_Done_Glyph(fg->glyph);
309 /* extension calls */
310 if (fg->ext_dat_free) fg->ext_dat_free(fg->ext_dat);
311 if (fg->glyph_out_free) fg->glyph_out_free(fg->glyph_out);
312 free(fg);
313 fmap->item[i] = NULL;
314 }
315 }
316 free(fmap);
317}
318
319static void
299_fash_gl2_free(Fash_Glyph_Map2 *fash) 320_fash_gl2_free(Fash_Glyph_Map2 *fash)
300{ 321{
301 int i; 322 int i;
302 323
303 for (i = 0; i < 256; i++) if (fash->bucket[i]) free(fash->bucket[i]); 324 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
325 for (i = 0; i < 256; i++) if (fash->bucket[i]) _fash_glyph_free(fash->bucket[i]);
304 free(fash); 326 free(fash);
305} 327}
306 328
@@ -309,6 +331,7 @@ _fash_gl_free(Fash_Glyph *fash)
309{ 331{
310 int i; 332 int i;
311 333
334 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
312 for (i = 0; i < 256; i++) if (fash->bucket[i]) _fash_gl2_free(fash->bucket[i]); 335 for (i = 0; i < 256; i++) if (fash->bucket[i]) _fash_gl2_free(fash->bucket[i]);
313 free(fash); 336 free(fash);
314} 337}