forked from enlightenment/efl
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
This commit is contained in:
parent
3cc0e400cd
commit
5778896735
|
@ -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_Item *fi = NULL;
|
||||||
Evas_Object_Textblock_Format *pfmt = c->fmt;
|
Evas_Object_Textblock_Format *pfmt = c->fmt;
|
||||||
|
pfmt->ref++;
|
||||||
|
|
||||||
off += fnode->offset;
|
off += fnode->offset;
|
||||||
/* No need to skip on the first run, or a non-visible one */
|
/* 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);
|
_layout_text_append_commit(c, &queue, n, rel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_format_unref_free(c->obj, pfmt);
|
||||||
|
|
||||||
if ((c->have_underline2) || (c->have_underline))
|
if ((c->have_underline2) || (c->have_underline))
|
||||||
{
|
{
|
||||||
if (*style_pad_b < c->underline_extend)
|
if (*style_pad_b < c->underline_extend)
|
||||||
|
|
Loading…
Reference in New Issue