From 811f1935355a606e66a5b6c754c6de40a3075de1 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Mon, 23 Mar 2009 11:46:14 +0000 Subject: [PATCH] use safe version to free sub menus. SVN revision: 39648 --- src/bin/e_int_menus.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c index 2a03d2ce1..68c481bac 100644 --- a/src/bin/e_int_menus.c +++ b/src/bin/e_int_menus.c @@ -571,11 +571,13 @@ _e_int_menus_apps_free_hook2(void *obj) { E_Menu *m; Efreet_Menu *menu; - Eina_List *l; + Eina_List *l, *l_next; E_Menu_Item *mi; m = obj; - EINA_LIST_FOREACH(m->items, l, mi) + // XXX TODO: this should be automatic in e_menu, just get references right! + // XXX TODO: fix references and remove me!!! + EINA_LIST_FOREACH_SAFE(m->items, l, l_next, mi) { if (mi->submenu) e_object_del(E_OBJECT(mi->submenu)); @@ -668,11 +670,13 @@ static void _e_int_menus_desktops_free_hook(void *obj) { E_Menu *m; - Eina_List *l; + Eina_List *l, *l_next; E_Menu_Item *mi; m = obj; - EINA_LIST_FOREACH(m->items, l, mi) + // XXX TODO: this should be automatic in e_menu, just get references right! + // XXX TODO: fix references and remove me!!! + EINA_LIST_FOREACH_SAFE(m->items, l, l_next, mi) { if (mi->submenu) e_object_del(E_OBJECT(mi->submenu));