diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-17 14:10:51 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-17 14:10:51 +0000 |
commit | 208136d1eac959f0147435131cfd2c4e3074286c (patch) | |
tree | c7f792323068924a675dcfe4d561abca97164684 /apps/menu.c | |
parent | daf66940b1a06de2681c91dcb8cf72d95a234e86 (diff) |
Reload the menu if do_menu() is called while another menu is running
(fixes crashing coming out of rec settings from fm menu)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12822 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menu.c')
-rw-r--r-- | apps/menu.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/menu.c b/apps/menu.c index dd5a23b933..4b71cbf40a 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -74,6 +74,7 @@ static void menu_talk_selected(int m); /* used to allow for dynamic menus */ #define MAX_MENU_SUBITEMS 64 +static struct menu_item_ex *current_submenus_menu; static int current_subitems[MAX_MENU_SUBITEMS]; static int current_subitems_count = 0; @@ -204,7 +205,8 @@ static void init_menu_lists(const struct menu_item_ex *menu, current_subitems_count++; } } - + current_submenus_menu = menu; + gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1); #ifdef HAVE_LCD_BITMAP if (menu->callback_and_desc->icon_id == Icon_NOICON) @@ -589,6 +591,8 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) } if (type != MT_MENU && menu_callback) menu_callback(ACTION_EXIT_MENUITEM,temp); + if (current_submenus_menu != menu) + init_menu_lists(menu,&lists,selected,true); /* callback was changed, so reload the menu's callback */ get_menu_callback(menu, &menu_callback); #ifdef HAS_BUTTONBAR |