evas/cserve2: fix memory leak when changing font hinting.

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
This commit is contained in:
Jean-Philippe Andre 2013-06-04 19:44:52 +09:00 committed by Cedric Bail
parent a5329fc680
commit e973be52f9
1 changed files with 11 additions and 0 deletions

View File

@ -671,6 +671,15 @@ evas_common_font_free(RGBA_Font *fn)
free(fn);
}
static void
_evas_common_font_rehint(RGBA_Font_Int *fi, Font_Hint_Flags hinting)
{
if (fi->fash)
fi->fash->freeme(fi->fash);
fi->fash = NULL;
fi->hinting = hinting;
}
EAPI void
evas_common_font_hinting_set(RGBA_Font *fn, Font_Hint_Flags hinting)
{
@ -681,6 +690,8 @@ evas_common_font_hinting_set(RGBA_Font *fn, Font_Hint_Flags hinting)
fn->hinting = hinting;
EINA_LIST_FOREACH(fn->fonts, l, fi)
{
if (fi->hinting != fn->hinting)
_evas_common_font_rehint(fi, fn->hinting);
fi->hinting = fn->hinting;
}
}