From: Youngbok Shin Date: Fri, 7 Dec 2018 06:27:13 +0000 (+0000) Subject: evas: remove memory leaks from deleted Textblock objects X-Git-Tag: submit/tizen/20190116.045417~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35216f64b1bf74390dd7052cdf62791ec1072262;p=platform%2Fupstream%2Fefl.git evas: remove memory leaks from deleted Textblock objects Even if a object is deleted, its render_pre function could be called. Especially, Evas Textblock is calling relayout() function if there are any changes. In relayout() function, it creates at least one paragraph and one line. Normally, all of paragraphs and its line should be removed when Evas Textblock object is deleted. But, paragraphs and lines which are created after deleting its object never be free'd. @fix Differential Revision: https://phab.enlightenment.org/D7427 --- diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 6c38268..f418c90 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -7029,6 +7029,8 @@ _relayout_if_needed(const Evas_Object *eo_obj, Efl_Canvas_Text_Data *o) ASYNC_BLOCK; Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); + if (obj->delete_me) return EINA_TRUE; + /* XXX const */ evas_object_textblock_coords_recalc((Evas_Object *)eo_obj, obj, obj->private_data); if (o->formatted.valid)