evas textblock: fix double free issue from user style push/pop and free
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 22 Feb 2018 05:47:22 +0000 (14:47 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Thu, 22 Feb 2018 05:49:08 +0000 (14:49 +0900)
commitba32fe7689e9bb6bed411ee2eaaed8857d126251
tree1c6417a83a4a717a448e99e179821bbe884c8695
parente4306f3f4301a6ddda6998eb33351d7589b5b8dc
evas textblock: fix double free issue from user style push/pop and free

Summary:
The Textblock Style which is created for user style was managed application side.
It is created and free'd from application - outside of Evas Textblock.
Recently, evas_object_textblock_style_user_push/pop start to call efl_canvas_text_style_set()
instead of legacy code. The problem is efl_canvas_text_style_set() is always going to call free()
when a style is going to be deleted.
It makes conflicts(double free issue) with application which is used to call evas_textblock_style_free().
So, the issue will be fixed by this patch.

The patch also revise push/pop/peek code to make clean and avoid meaningless calculation/events.
@fix

Test Plan:
A test case is Included in this patch.
The test case try to trigger double free.

Reviewers: herdsman, raster, cedric

Subscribers: woohyun

Differential Revision: https://phab.enlightenment.org/D5812
src/lib/evas/canvas/evas_object_textblock.c
src/tests/evas/evas_test_textblock.c