From 77a7e7eecdfe084b20bfedc1ca8301826bc15710 Mon Sep 17 00:00:00 2001 From: Bernhard Schelling <14200249+schellingb@users.noreply.github.com> Date: Tue, 28 Jul 2020 21:06:20 +0900 Subject: [PATCH] Fix 2 memory leaks in explore view Free cached playlist that could have been loaded before entering explore view Free temporary hashmap used to filter sub-categories --- menu/menu_explore.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/menu/menu_explore.c b/menu/menu_explore.c index 033d2908a5..1b128aa74a 100644 --- a/menu/menu_explore.c +++ b/menu/menu_explore.c @@ -901,6 +901,12 @@ unsigned menu_displaylist_explore(file_list_t *list) " '%s'", explore_state->find_string); } + if (current_type == MENU_EXPLORE_TAB) + { + // free any existing playlist when entering the explore view + playlist_free_cached(); + } + playlist_set_cached(NULL); if ( current_type == MENU_EXPLORE_TAB @@ -1112,6 +1118,8 @@ SKIP_ENTRY:; explore_append_title(explore_state, " (%u)", (unsigned) (list->size - 1)); + + ex_hashmap32_free(&map_filtered_category); } else {