Fix menu_driver_list_insert leaks

This commit is contained in:
Higor Eurípedes 2015-06-15 14:18:06 -03:00
parent b8d2cad194
commit b304ddcf7a
2 changed files with 7 additions and 1 deletions

View File

@ -541,7 +541,9 @@ static int action_iterate_main(const char *label, unsigned action)
do_pop_stack = true;
break;
case ITERATE_TYPE_DEFAULT:
selected = menu_navigation_get_current_selection();
selected = menu_navigation_get_current_selection();
selected = max(min(selected, menu_list_get_size(menu_list)-1), 0);
menu_entry_get(&entry, selected, NULL, false);
ret = menu_entry_action(&entry, selected, (enum menu_action)action);

View File

@ -197,9 +197,13 @@ void menu_driver_list_free(file_list_t *list, size_t idx, size_t list_size)
void menu_driver_list_clear(file_list_t *list)
{
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
unsigned i;
if (driver->list_clear)
driver->list_clear(list);
for (i = 0; i < list->size; i++)
file_list_free_actiondata(list, i);
}
void menu_driver_context_destroy(void)