summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Hirt <hirt.danny@gmail.com>2018-07-16 00:35:44 +0300
committerDaniel Hirt <hirt.danny@gmail.com>2018-07-16 16:45:53 +0300
commitcafe84a2c2eeffe8c252d8988c7b6e5fcfe9f2c5 (patch)
treeab19c3758772e1a79ecfaa56f5436c79ddb593f8 /src
parent93397449d4051fe3f545660cc74aad38355dee55 (diff)
Evas text textblock: call evas_font_free even on null fonts
A null font set can potentially be stored and passed on. There is no specific fallback in our codebase to roll-back if something like that occurs. This fixes a case where an entry of a null font was not removed from the fonts_cache and was leaked to subsequent tests (the null font entry was not removed from the fonts_cache). Note that this was only apparent when EFL was built with `--disable-fontconfig`, likely due to fontconfig succeeding to always retrieve some non-null font. @fix
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_object_text.c9
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c2
2 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 82be722deb..315b7ce015 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -433,11 +433,8 @@ _evas_text_font_reload(Eo *eo_obj, Evas_Text_Data *o)
433 } 433 }
434 434
435 /* DO IT */ 435 /* DO IT */
436 if (o->font) 436 evas_font_free(o->font);
437 { 437 o->font = NULL;
438 evas_font_free(o->font);
439 o->font = NULL;
440 }
441 438
442 o->font = evas_font_load(obj->layer->evas->font_path, 439 o->font = evas_font_load(obj->layer->evas->font_path,
443 obj->layer->evas->hinting, 440 obj->layer->evas->hinting,
@@ -1656,7 +1653,7 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
1656 if (o->cur.source) eina_stringshare_del(o->cur.source); 1653 if (o->cur.source) eina_stringshare_del(o->cur.source);
1657 if (o->bidi_delimiters) eina_stringshare_del(o->bidi_delimiters); 1654 if (o->bidi_delimiters) eina_stringshare_del(o->bidi_delimiters);
1658 if (o->cur.text) free(o->cur.text); 1655 if (o->cur.text) free(o->cur.text);
1659 if (o->font && obj->layer && obj->layer->evas) 1656 if (obj->layer && obj->layer->evas)
1660 evas_font_free(o->font); 1657 evas_font_free(o->font);
1661 o->font = NULL; 1658 o->font = NULL;
1662 o->cur.utf8_text = NULL; 1659 o->cur.utf8_text = NULL;
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 652ac3e631..f523f131e9 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -4575,7 +4575,7 @@ _format_finalize(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt)
4575 fmt->font.source, 4575 fmt->font.source,
4576 (int)(((double) fmt->font.size) * obj->cur->scale), 4576 (int)(((double) fmt->font.size) * obj->cur->scale),
4577 fmt->font.bitmap_scalable); 4577 fmt->font.bitmap_scalable);
4578 if (of) evas_font_free(of); 4578 evas_font_free(of);
4579} 4579}
4580 4580
4581static Efl_Canvas_Text_Filter_Program * 4581static Efl_Canvas_Text_Filter_Program *