[EGIT] [core/efl] master 01/01: svg/loader: Fix memory leak
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=161e411d183f0b2d5c19a3a99b5e91e2246f5541 commit 161e411d183f0b2d5c19a3a99b5e91e2246f5541 Author: Subhransu Mohanty Date: Mon Jun 1 18:53:36 2020 +0900 svg/loader: Fix memory leak Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11908 --- src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 5 - src/static_libs/vg_common/vg_common_svg.c | 6 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c index 313d3eed15..9151e05c15 100644 --- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c +++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c @@ -2410,6 +2410,7 @@ static Eina_Bool evas_vg_load_file_close_svg(Vg_File_Data *vfd) { if (vfd->root) efl_unref(vfd->root); + free(vfd); return EINA_TRUE; } @@ -2462,7 +2463,9 @@ evas_vg_load_file_open_svg(Eina_File *file, } free(loader.svg_parse); - return vg_common_svg_create_vg_node(loader.doc); + Vg_File_Data* result = vg_common_svg_create_vg_node(loader.doc); + vg_common_svg_node_free(loader.doc); + return result; } static Evas_Vg_Load_Func evas_vg_load_svg_func = diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index de5477bb0e..058cdf99e0 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -536,12 +536,14 @@ vg_common_svg_node_free(Svg_Node *node) { _svg_style_gradient_free(grad); } +case SVG_NODE_CUSTOME_COMMAND: + if (node->node.command.commands) free(node->node.command.commands); + if (node->node.command.points) free(node->node.command.points); break; default: break; } - if (node->node.command.commands_count > 0) free(node->node.command.commands); - if (node->node.command.points_count > 0) free(node->node.command.points); + free(node); } --
[EGIT] [core/efl] master 01/01: elementary: Fix memory leak in elm_list
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=025e7238e7d8a2d190a525387e45304a82a8a6cc commit 025e7238e7d8a2d190a525387e45304a82a8a6cc Author: Subhransu Mohanty Date: Mon Jun 1 18:57:24 2020 +0900 elementary: Fix memory leak in elm_list Reviewers: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11909 --- src/lib/elementary/elm_list.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c index 4447ea2f05..6936cb2e85 100644 --- a/src/lib/elementary/elm_list.c +++ b/src/lib/elementary/elm_list.c @@ -1060,6 +1060,8 @@ _items_fix(Evas_Object *obj) //focus highlight in_theme is set by list item theme. _elm_widget_item_highlight_in_theme( obj, elm_list_first_item_get(obj)); + + eina_array_flush(&walk); } static void --
[EGIT] [core/efl] master 01/01: elm_hoversel: Add missing resize_job's free
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=214e5d2cf8f0c63c9222a990a7333c49a50459ae commit 214e5d2cf8f0c63c9222a990a7333c49a50459ae Author: JunsuChoi Date: Tue Jun 2 12:26:51 2020 +0900 elm_hoversel: Add missing resize_job's free Summary: resize_job can be called after obj is deleted. So add free to destructor. Test Plan: N/A Reviewers: Hermet, herb, kimcinoo, zmike Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11911 --- src/lib/elementary/elc_hoversel.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index b94aa6177b..6a9708c407 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -721,8 +721,11 @@ _elm_hoversel_efl_object_constructor(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED } EOLIAN static void -_elm_hoversel_efl_object_destructor(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED) +_elm_hoversel_efl_object_destructor(Eo *obj, Elm_Hoversel_Data *_pd) { + if (_pd->resize_job) + ELM_SAFE_FREE(_pd->resize_job, ecore_job_del); + elm_obj_hoversel_clear(obj); efl_destructor(efl_super(obj, MY_CLASS)); } --
[EGIT] [core/efl] master 01/01: canvas svg: fix missing break.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9d1423f2033cdd59db1d2f6f33df878d1de040fa commit 9d1423f2033cdd59db1d2f6f33df878d1de040fa Author: Hermet Park Date: Tue Jun 2 09:59:51 2020 +0900 canvas svg: fix missing break. --- src/static_libs/vg_common/vg_common_svg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index 058cdf99e0..f5b71c43d2 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -536,9 +536,10 @@ vg_common_svg_node_free(Svg_Node *node) { _svg_style_gradient_free(grad); } + break; case SVG_NODE_CUSTOME_COMMAND: if (node->node.command.commands) free(node->node.command.commands); - if (node->node.command.points) free(node->node.command.points); + if (node->node.command.points) free(node->node.command.points); break; default: break; --
[EGIT] [core/efl] master 04/04: build: do not link test suite again against static libs
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6184bf670fd6ee738585ec215c9a0dc62176659c commit 6184bf670fd6ee738585ec215c9a0dc62176659c Author: Marcel Hollerbach Date: Mon Jun 1 22:32:53 2020 +0200 build: do not link test suite again against static libs this might result in duplicated symbols. --- src/tests/evas/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/evas/meson.build b/src/tests/evas/meson.build index b76d4572b3..765afd9960 100644 --- a/src/tests/evas/meson.build +++ b/src/tests/evas/meson.build @@ -25,7 +25,7 @@ evas_suite_src = [ evas_suite = executable('evas_suite', evas_suite_src, - dependencies: [evas_bin, evas, ecore_evas, dl, check, evas_ext_deps], #external deps needed here since tests do include internal headers + dependencies: [evas_bin, evas, ecore_evas, dl, check, evas_ext_none_static_deps], #external deps needed here since tests do include internal headers include_directories: include_directories(join_paths('..', '..', 'modules', 'evas', 'engines', 'buffer')), c_args : [ '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', --
[EGIT] [core/efl] master 02/04: elm_gesture_layer: Arrange the logic for delete the target object in gesture cb.
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5ca1a8c8a7fed96260b7d3faa5a12f55ac790855 commit 5ca1a8c8a7fed96260b7d3faa5a12f55ac790855 Author: Woochanlee Date: Tue May 26 06:36:54 2020 + elm_gesture_layer: Arrange the logic for delete the target object in gesture cb. When the user receives the callback of gesture callback, erases the target object, the gesture layer is deleted. The memory is may broken and performing unnecessary operations during the logic. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11838 --- src/lib/elementary/elm_gesture_layer.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/lib/elementary/elm_gesture_layer.c b/src/lib/elementary/elm_gesture_layer.c index 1f729187df..9e1a787c4e 100644 --- a/src/lib/elementary/elm_gesture_layer.c +++ b/src/lib/elementary/elm_gesture_layer.c @@ -1145,11 +1145,12 @@ _pending_device_add(Eina_List *list, * user may cancel refeed of events by setting repeat events. * * @param obj The gesture-layer object. + * @param need_reset Clear all gestures data or not. * * @ingroup Elm_Gesture_Layer */ static Eina_Bool -_event_history_clear(Evas_Object *obj) +_event_history_clear(Evas_Object *obj, Eina_Bool need_reset) { int i; Gesture_Info *p; @@ -1179,16 +1180,17 @@ _event_history_clear(Evas_Object *obj) _states_reset(sd); /* we are ready to start testing for gestures again */ /* Clear all gestures intermediate data */ - { - /* FIXME: +1 because of the mistake in the enum. */ - Gesture_Info **gitr = sd->gesture + 1; - Tests_Array_Funcs *fitr = _glayer_tests_array + 1; - for (; fitr->reset; fitr++, gitr++) -{ - if (IS_TESTED_GESTURE(*gitr)) - fitr->reset(*gitr); -} - } + if (need_reset) + { +/* FIXME: +1 because of the mistake in the enum. */ +Gesture_Info **gitr = sd->gesture + 1; +Tests_Array_Funcs *fitr = _glayer_tests_array + 1; +for (; fitr->reset; fitr++, gitr++) + { + if (IS_TESTED_GESTURE(*gitr)) + fitr->reset(*gitr); + } + } /* Disable gesture layer so refeeded events won't be consumed by it */ _callbacks_unregister(obj); @@ -1263,7 +1265,7 @@ _clear_if_finished(Evas_Object *obj) } if (reset_s && (!all_undefined)) - return _event_history_clear(obj); + return _event_history_clear(obj, EINA_TRUE); return EINA_FALSE; } @@ -1348,6 +1350,7 @@ _event_process(void *data, ELM_GESTURE_LAYER_DATA_GET(data, sd); + evas_object_ref(sd->target); /* Start testing candidate gesture from here */ if (_pointer_event_make(data, event_info, event_type, &_pe)) pe = &_pe; @@ -1386,6 +1389,8 @@ _event_process(void *data, Eina_Bool states_reset = _clear_if_finished(data); if (sd->glayer_continues_enable) _continues_gestures_restart(data, states_reset); + + evas_object_unref(sd->target); } static Eina_Bool @@ -3812,7 +3817,7 @@ _elm_gesture_layer_efl_canvas_group_group_del(Eo *obj, Elm_Gesture_Layer_Data *s ecore_timer_del(sd->gest_taps_timeout); /* Then take care of clearing events */ - _event_history_clear(obj); + _event_history_clear(obj, EINA_FALSE); sd->pending = eina_list_free(sd->pending); EINA_LIST_FREE(sd->touched, data) --
[EGIT] [core/efl] master 01/04: eo: Fix memory leak in efl_key_wref_set() api.
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5797129334789c1471bfadb640776b4a5d6e41b4 commit 5797129334789c1471bfadb640776b4a5d6e41b4 Author: Subhransu Mohanty Date: Wed May 27 07:39:59 2020 + eo: Fix memory leak in efl_key_wref_set() api. Testcase: elementary_test -to snapshot Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11888 --- src/lib/eo/eo_base_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index 44fe92cf4a..565f4805e8 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -415,7 +415,7 @@ _key_generic_cb_del(void *data, const Efl_Event *event EINA_UNUSED) { Eo_Generic_Data_Node *node = data; Efl_Object_Data *pd = efl_data_scope_get(node->obj, EFL_OBJECT_CLASS); - _eo_key_generic_direct_del(pd, node, EINA_FALSE); + _eo_key_generic_direct_del(pd, node, EINA_TRUE); } EOLIAN static void --
[EGIT] [core/efl] master 03/04: efl_access_text: remove ptr usage in eo files
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ff3d3b19447c2eaa5378ea2e303f7a696d5370ef commit ff3d3b19447c2eaa5378ea2e303f7a696d5370ef Author: Ali Alzyod Date: Sun May 31 06:16:46 2020 + efl_access_text: remove ptr usage in eo files Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11907 --- src/lib/elementary/efl_access_text.eo | 18 +++ src/lib/elementary/efl_ui_textbox.c | 39 ++--- src/lib/elementary/elm_atspi_bridge.c | 7 +++--- src/lib/elementary/elm_entry.c| 41 +++ src/lib/elementary/elm_entry_eo.c | 4 ++-- src/tests/elementary/elm_test_entry.c | 28 6 files changed, 71 insertions(+), 66 deletions(-) diff --git a/src/lib/elementary/efl_access_text.eo b/src/lib/elementary/efl_access_text.eo index 95cc367c3c..b40dc1a4eb 100644 --- a/src/lib/elementary/efl_access_text.eo +++ b/src/lib/elementary/efl_access_text.eo @@ -66,12 +66,12 @@ interface @beta Efl.Access.Text } keys { granularity: Efl.Access.Text_Granularity; [[Text granularity]] -start_offset: ptr(int); [[Offset indicating start of string according to given granularity. - -1 in case of error.]] -end_offset: ptr(int); [[Offset indicating end of string according to given granularity. --1 in case of error.]] } values { +start_offset: int; [[Offset indicating start of string according to given granularity. + -1 in case of error.]] +end_offset: int; [[Offset indicating end of string according to given granularity. +-1 in case of error.]] string: mstring @move; [[Newly allocated UTF-8 encoded string. Must be free by a user.]] } } @@ -105,10 +105,10 @@ interface @beta Efl.Access.Text } keys { name: string; [[Text attribute name]] -start_offset: ptr(int); [[Position in text from which given attribute is set.]] -end_offset: ptr(int); [[Position in text to which given attribute is set.]] } values { +start_offset: int; [[Position in text from which given attribute is set.]] +end_offset: int; [[Position in text to which given attribute is set.]] value: mstring @move; [[Value of text attribute. Should be free()]] } } @@ -116,11 +116,9 @@ interface @beta Efl.Access.Text [[Gets list of all text attributes.]] get { } - keys { -start_offset: ptr(int); [[Start offset]] -end_offset: ptr(int); [[End offset]] - } values { +start_offset: int; [[Start offset]] +end_offset: int; [[End offset]] attributes: list @move; [[List of text attributes]] } } diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c index 64f1034638..bd97b47db7 100644 --- a/src/lib/elementary/efl_ui_textbox.c +++ b/src/lib/elementary/efl_ui_textbox.c @@ -2099,11 +2099,13 @@ _efl_ui_textbox_efl_access_text_character_count_get(const Eo *obj, Efl_Ui_Textbo return eina_unicode_utf8_get_len(txt); } -EOLIAN static char* -_efl_ui_textbox_efl_access_text_string_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *pd, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset) +EOLIAN static void +_efl_ui_textbox_efl_access_text_string_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *pd, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset, char **ret EFL_TRANSFER_OWNERSHIP) { Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL; - char *ret = NULL; + + EINA_SAFETY_ON_NULL_RETURN(ret); + *ret = NULL; cur = evas_object_textblock_cursor_new(pd->text_obj); cur2 = evas_object_textblock_cursor_new(pd->text_obj); @@ -2158,26 +2160,26 @@ _efl_ui_textbox_efl_access_text_string_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tex if (end_offset) *end_offset = evas_textblock_cursor_pos_get(cur2); - ret = evas_textblock_cursor_range_text_get(cur, cur2, EVAS_TEXTBLOCK_TEXT_PLAIN); + *ret = evas_textblock_cursor_range_text_get(cur, cur2, EVAS_TEXTBLOCK_TEXT_PLAIN); evas_textblock_cursor_free(cur); evas_textblock_cursor_free(cur2); - if (ret && efl_text_password_get(obj)) + if (*ret && efl_text_password_get(obj)) { int i = 0; -while (ret[i] != '\0') - ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER; +while (*ret[i] != '\0') + *ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER; } - return ret; + return; fail: if (start_offset) *start_offset = -1; if (end_offset) *end_offset = -1;
[EGIT] [core/efl] master 01/01: build: add eet to evas suite
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=41c90a9ae3d48796884f65efbee995fae50bf7cd commit 41c90a9ae3d48796884f65efbee995fae50bf7cd Author: Marcel Hollerbach Date: Tue Jun 2 08:28:27 2020 +0200 build: add eet to evas suite evas suite seems to use internal headers, which includes eet. --- src/tests/evas/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/evas/meson.build b/src/tests/evas/meson.build index 765afd9960..bee736035f 100644 --- a/src/tests/evas/meson.build +++ b/src/tests/evas/meson.build @@ -25,7 +25,7 @@ evas_suite_src = [ evas_suite = executable('evas_suite', evas_suite_src, - dependencies: [evas_bin, evas, ecore_evas, dl, check, evas_ext_none_static_deps], #external deps needed here since tests do include internal headers + dependencies: [evas_bin, evas, ecore_evas, dl, check, evas_ext_none_static_deps, eet], #external deps needed here since tests do include internal headers include_directories: include_directories(join_paths('..', '..', 'modules', 'evas', 'engines', 'buffer')), c_args : [ '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"', --