From 5778896735c0826176872e389879fae914b0500d Mon Sep 17 00:00:00 2001 From: Daniel Hirt Date: Tue, 25 Mar 2014 17:10:38 +0200 Subject: [PATCH] Evas Textblock: increase ref of format before work We need to increase ref count for the format prior to calling of functions that handle the layout. This resolves valgrind error of accessing already freed memory. Please note that a scenerio to trigger this exists in test suite, and for some reason is not being detected by jenkins. @fix --- src/lib/evas/canvas/evas_object_textblock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 3b22bf0222..813d4798f3 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -5075,6 +5075,7 @@ _layout_pre(Ctxt *c, int *style_pad_l, int *style_pad_r, int *style_pad_t, { Evas_Object_Textblock_Format_Item *fi = NULL; Evas_Object_Textblock_Format *pfmt = c->fmt; + pfmt->ref++; off += fnode->offset; /* No need to skip on the first run, or a non-visible one */ @@ -5093,6 +5094,8 @@ _layout_pre(Ctxt *c, int *style_pad_l, int *style_pad_r, int *style_pad_t, _layout_text_append_commit(c, &queue, n, rel); } + _format_unref_free(c->obj, pfmt); + if ((c->have_underline2) || (c->have_underline)) { if (*style_pad_b < c->underline_extend)