summaryrefslogtreecommitdiff
path: root/src/lib/elm_toolbar.c
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-12-26 18:40:14 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-12-26 18:41:48 +0900
commitea6e0152753893bf89eabf443130a7cf57879f95 (patch)
tree7dc88e1c451c98d128a46298cfcbfd860846954a /src/lib/elm_toolbar.c
parentcedf8e6b947edf49504f250a3fc5d8084abb57fe (diff)
gengrid, genlist, list, toolbar: Fix memory leak and enhance performance.
1. Fix memory leak by freeing eina_list. 2. Enhance performance by getting the item list when it is really needed. @fix
Diffstat (limited to 'src/lib/elm_toolbar.c')
-rw-r--r--src/lib/elm_toolbar.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index cff0cf02a..94320d33d 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -685,19 +685,16 @@ _elm_toolbar_nearest_visible_item_get(Evas_Object *obj, Elm_Object_Item *eo_it)
685 evas_object_geometry_get(obj, &vx, &vy, &vw, &vh); 685 evas_object_geometry_get(obj, &vx, &vy, &vw, &vh);
686 evas_object_geometry_get(VIEW(it), &ix, &iy, &iw, &ih); 686 evas_object_geometry_get(VIEW(it), &ix, &iy, &iw, &ih);
687 687
688 item_list = evas_object_box_children_get(sd->bx);
689
690 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih)) 688 if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, ix, iy, iw, ih))
691 { 689 {
692 if (!elm_object_item_disabled_get(eo_it)) 690 if (!elm_object_item_disabled_get(eo_it))
693 { 691 return eo_it;
694 eina_list_free(item_list);
695 return eo_it;
696 }
697 else 692 else
698 search_next = EINA_TRUE; 693 search_next = EINA_TRUE;
699 } 694 }
700 695
696 item_list = evas_object_box_children_get(sd->bx);
697
701 if ((sd->vertical && (iy < vy)) || 698 if ((sd->vertical && (iy < vy)) ||
702 (!sd->vertical && (iw < vw)) || 699 (!sd->vertical && (iw < vw)) ||
703 search_next) 700 search_next)