From 8b24cd8c808e6b882de27ec0e1a7e53f0f9a8ba8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 26 May 2015 04:33:35 +0200 Subject: [PATCH] Cleanup menu_displaylist_parse --- menu/menu_displaylist.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 070b4f37a0..ad4c529661 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -1895,7 +1895,6 @@ static int menu_displaylist_parse(menu_displaylist_info_t *info, case DISPLAYLIST_HISTORY: { char path_playlist[PATH_MAX_LENGTH]; - bool free_list = false; content_playlist_t *playlist = NULL; switch (type) @@ -1905,13 +1904,16 @@ static int menu_displaylist_parse(menu_displaylist_info_t *info, strlcpy(path_playlist, "history", sizeof(path_playlist)); break; case DISPLAYLIST_PLAYLIST_COLLECTION: + if (menu->playlist) + content_playlist_free(menu->playlist); + fill_pathname_join(path_playlist, settings->playlist_directory, info->path, sizeof(path_playlist)); - playlist = content_playlist_init(path_playlist, + menu->playlist = content_playlist_init(path_playlist, 999); strlcpy(path_playlist, "collection", sizeof(path_playlist)); - free_list = true; + playlist = menu->playlist; break; default: break; @@ -1924,9 +1926,6 @@ static int menu_displaylist_parse(menu_displaylist_info_t *info, *need_refresh = true; *need_push = true; } - - if (free_list) - content_playlist_free(playlist); } break; case DISPLAYLIST_OPTIONS_DISK: