From 4cbffe7b30c02909a776095a9ab0722f00f97d92 Mon Sep 17 00:00:00 2001 From: cedric Date: Wed, 20 Jun 2012 05:02:57 +0000 Subject: [PATCH] evas: don't forget to destroy all the cached Evas_Text_Props on font change. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@72516 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_textgrid.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lib/canvas/evas_object_textgrid.c b/src/lib/canvas/evas_object_textgrid.c index e8ea707..187e8ae 100644 --- a/src/lib/canvas/evas_object_textgrid.c +++ b/src/lib/canvas/evas_object_textgrid.c @@ -1175,6 +1175,27 @@ evas_object_textgrid_font_set(Evas_Object *obj, const char *font_name, Evas_Font o->core_change = 1; evas_object_textgrid_rows_clear(obj); evas_object_change(obj); + + /* Force destroy of all cached Evas_Text_Props */ + while (eina_array_count(&o->glyphs_cleanup) > 0) + { + Evas_Text_Props *prop; + unsigned int props_index; + + props_index = (unsigned int) (intptr_t) eina_array_pop(&o->glyphs_cleanup); + prop = &(o->glyphs[props_index >> 8].props[props_index & 0xFF]); + + evas_common_text_props_content_unref(prop); + if (!prop->info) + { + o->glyphs_used[props_index >> 8]--; + + if (!o->glyphs_used[props_index >> 8]) + { + /* FIXME: cleanup the master tree */ + } + } + } } EAPI void -- 2.7.4