mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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
This commit is contained in:
parent
daf66940b1
commit
208136d1ea
1 changed files with 5 additions and 1 deletions
|
@ -74,6 +74,7 @@ static void menu_talk_selected(int m);
|
||||||
|
|
||||||
/* used to allow for dynamic menus */
|
/* used to allow for dynamic menus */
|
||||||
#define MAX_MENU_SUBITEMS 64
|
#define MAX_MENU_SUBITEMS 64
|
||||||
|
static struct menu_item_ex *current_submenus_menu;
|
||||||
static int current_subitems[MAX_MENU_SUBITEMS];
|
static int current_subitems[MAX_MENU_SUBITEMS];
|
||||||
static int current_subitems_count = 0;
|
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_subitems_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
current_submenus_menu = menu;
|
||||||
|
|
||||||
gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1);
|
gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1);
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
if (menu->callback_and_desc->icon_id == Icon_NOICON)
|
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)
|
if (type != MT_MENU && menu_callback)
|
||||||
menu_callback(ACTION_EXIT_MENUITEM,temp);
|
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 */
|
/* callback was changed, so reload the menu's callback */
|
||||||
get_menu_callback(menu, &menu_callback);
|
get_menu_callback(menu, &menu_callback);
|
||||||
#ifdef HAS_BUTTONBAR
|
#ifdef HAS_BUTTONBAR
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue