cedric pushed a commit to branch master.
commit e973be52f90df7c620ad5c0010570cd01aa92739
Author: Jean-Philippe Andre <[email protected]>
Date: Tue Jun 4 19:44:52 2013 +0900
evas/cserve2: fix memory leak when changing font hinting.
Signed-off-by: Cedric Bail <[email protected]>
---
src/lib/evas/common/evas_font_load.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/lib/evas/common/evas_font_load.c
b/src/lib/evas/common/evas_font_load.c
index 97dfb17..6a94c9c 100644
--- a/src/lib/evas/common/evas_font_load.c
+++ b/src/lib/evas/common/evas_font_load.c
@@ -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;
}
}
--
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j