Page MenuHomePhabricator

evas_vg_load_eet: Prevent memory leak for vg load from eet.
AbandonedPublic

Authored by jsuya on May 25 2020, 11:23 PM.

Details

Summary

When loading a vector file in EET, it creates Vg_File_Data
and does not free it. So add code to free it.

==310== 480 bytes in 6 blocks are definitely lost in loss record 2,209 of 2,629
==310==    at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==310==    by 0x53CADCC: vg_common_svg_create_vg_node (vg_common_svg.c:899)                       
==310==    by 0x551E0CD: evas_vg_load_file_open_eet (evas_vg_load_eet.c:39)
==310==    by 0x5512ED8: _vg_load_from_file (evas_vg_cache.c:86)
==310==    by 0x5512ED8: evas_cache_vg_file_open (evas_vg_cache.c:336)
==310==    by 0x55135AF: evas_cache_vg_entry_create (evas_vg_cache.c:384)
==310==    by 0x54E1DE7: _efl_canvas_vg_object_efl_file_load (efl_canvas_vg_object.c:293)
==310==    by 0x69A5626: efl_file_load (efl_file.eo.c:88)
==310==    by 0x69A71C5: efl_file_simple_load (efl_file.c:183)
==310==    by 0x509E3C4: _edje_vector_recalc_apply (edje_calc.c:3330)
==310==    by 0x509E3C4: _edje_part_recalc (edje_calc.c:4915)
==310==    by 0x509ECA6: _edje_recalc_table_parts (edje_calc.c:945)
==310==    by 0x509ECA6: _edje_recalc_do (edje_calc.c:980)
==310==    by 0x510C6FF: _efl_canvas_layout_efl_canvas_group_group_calculate (edje_smart.c:402)
==310==    by 0x545EC2C: efl_canvas_group_calculate (efl_canvas_group.eo.c:44)
Test Plan

cd ./src/examples/edje
edje_cc -beta svg.edc && gcc -o svg-test svg-test.c pkg-config --libs --cflags evas ecore ecore-evas edje
valgrind --tool=memcheck --leak-check=yes --log-file=/tmp/memcheck.out --error-limit=no ./svg-test

Diff Detail

Repository
rEFL core/efl
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16831
Build 11192: arc lint + arc unit
jsuya created this revision.May 25 2020, 11:23 PM
jsuya requested review of this revision.May 25 2020, 11:23 PM
jsuya edited the summary of this revision. (Show Details)May 25 2020, 11:24 PM
jsuya abandoned this revision.May 26 2020, 2:54 AM