From 45803968c53776e7d1ce3f2df591fd177998e0bf Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 28 Aug 2012 08:36:50 +0000 Subject: [PATCH] free ctx action list as we add so we don't have to loop twice SVN revision: 75766 --- src/bin/e_fm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index 656fd1c1f..cc66b4a61 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -8441,8 +8441,7 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp) if (l) { _e_fm2_icon_realpath(ic, buf, sizeof(buf)); - _e_fm2_context_menu_append(obj, buf, l, mn, ic); - eina_list_free(l); + _e_fm2_context_menu_append(obj, buf, l, mn, ic); // frees l } } @@ -8455,8 +8454,7 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp) if (l) { _e_fm2_icon_realpath(ic, buf, sizeof(buf)); - _e_fm2_context_menu_append(obj, buf, l, mn, ic); - eina_list_free(l); + _e_fm2_context_menu_append(obj, buf, l, mn, ic); // frees l } } @@ -8494,14 +8492,13 @@ static void _e_fm2_context_menu_append(Evas_Object *obj, const char *path, Eina_List *l, E_Menu *mn, E_Fm2_Icon *ic) { E_Fm2_Mime_Handler *handler; - const Eina_List *ll; Eina_Bool added = EINA_FALSE; if (!l) return; l = eina_list_sort(l, -1, _e_fm2_context_list_sort); - EINA_LIST_FOREACH(l, ll, handler) + EINA_LIST_FREE(l, handler) { E_Fm2_Context_Menu_Data *md = NULL; E_Menu_Item *mi;