1
0
mirror of https://github.com/libretro/RetroArch synced 2025-04-01 13:20:43 +00:00

Only call menu_list_pop from one place

This commit is contained in:
twinaphex 2015-05-18 21:58:17 +02:00
parent 6d91c1576d
commit 2fb240894c

@ -205,9 +205,6 @@ static int action_iterate_help(const char *label, unsigned action)
menu_driver_render_messagebox(msg); menu_driver_render_messagebox(msg);
if (action == MENU_ACTION_OK)
menu_list_pop(menu->menu_list->menu_stack, NULL);
return ret; return ret;
} }
@ -507,7 +504,7 @@ static int action_iterate_main(const char *label, unsigned action)
{ {
enum action_iterate_type iterate_type; enum action_iterate_type iterate_type;
menu_entry_t entry; menu_entry_t entry;
size_t selected; size_t selected, *pop_selected = false;
bool do_pop_stack = false; bool do_pop_stack = false;
bool do_post_iterate = false; bool do_post_iterate = false;
bool do_render = false; bool do_render = false;
@ -523,6 +520,8 @@ static int action_iterate_main(const char *label, unsigned action)
{ {
case ITERATE_TYPE_HELP: case ITERATE_TYPE_HELP:
ret = action_iterate_help(label, action); ret = action_iterate_help(label, action);
pop_selected = NULL;
do_pop_stack = true;
do_post_iterate = true; do_post_iterate = true;
break; break;
case ITERATE_TYPE_BIND: case ITERATE_TYPE_BIND:
@ -534,6 +533,7 @@ static int action_iterate_main(const char *label, unsigned action)
break; break;
case ITERATE_TYPE_INFO: case ITERATE_TYPE_INFO:
ret = action_iterate_info(label, action); ret = action_iterate_info(label, action);
pop_selected = &menu->navigation.selection_ptr;
do_pop_stack = true; do_pop_stack = true;
do_post_iterate = true; do_post_iterate = true;
break; break;
@ -542,6 +542,7 @@ static int action_iterate_main(const char *label, unsigned action)
break; break;
case ITERATE_TYPE_MESSAGE: case ITERATE_TYPE_MESSAGE:
ret = action_iterate_message(label, action); ret = action_iterate_message(label, action);
pop_selected = &menu->navigation.selection_ptr;
do_pop_stack = true; do_pop_stack = true;
break; break;
case ITERATE_TYPE_DEFAULT: case ITERATE_TYPE_DEFAULT:
@ -569,7 +570,7 @@ static int action_iterate_main(const char *label, unsigned action)
} }
if (do_pop_stack && action == MENU_ACTION_OK) if (do_pop_stack && action == MENU_ACTION_OK)
menu_list_pop(menu_list->menu_stack, &menu->navigation.selection_ptr); menu_list_pop(menu_list->menu_stack, pop_selected);
if (do_post_iterate) if (do_post_iterate)
menu_input_post_iterate(&ret, action); menu_input_post_iterate(&ret, action);