summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_font_main.c
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/common/evas_font_main.c
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 '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_main.c25
1 files changed, 24 insertions, 1 deletions
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}