From d9c9aae1123304b0a6069e17a30f56572ba42b5f Mon Sep 17 00:00:00 2001 From: Andrii Kroitor Date: Fri, 26 Dec 2014 11:26:42 +0900 Subject: [PATCH] elm_toolbar: fix memory leak in _elm_toolbar_nearest_visible_item_get @fix Reviewers: cedric, seoz, Hermet, raster Subscribers: reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D1822 --- src/lib/elm_toolbar.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 8ba4e3c..cff0cf0 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -690,7 +690,10 @@ _elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *eo_it) if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih)) { if (!elm_object_item_disabled_get(eo_it)) - return eo_it; + { + eina_list_free(item_list); + return eo_it; + } else search_next = EINA_TRUE; } @@ -709,7 +712,10 @@ _elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *eo_it) evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) && !elm_object_item_disabled_get(EO_OBJ(item))) - return EO_OBJ(item); + { + eina_list_free(item_list); + return EO_OBJ(item); + } } } else @@ -724,9 +730,13 @@ _elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *eo_it) evas_object_geometry_get(VIEW(item), &cx, &cy, &cw, &ch); if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) && !elm_object_item_disabled_get(EO_OBJ(item))) - return EO_OBJ(item); + { + eina_list_free(item_list); + return EO_OBJ(item); + } } } + eina_list_free(item_list); return eo_it; } -- 2.7.4