summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c1
-rw-r--r--src/ui.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 174d144..f011c5a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -301,6 +301,7 @@ static void BarMainLoop (BarApp_t *app) {
if (app->playlist != NULL) {
PianoSong_t *histsong = app->playlist;
app->playlist = app->playlist->next;
+ histsong->next = NULL;
BarUiHistoryPrepend (app, histsong);
}
if (app->playlist == NULL) {
diff --git a/src/ui.c b/src/ui.c
index 8543018..d5def60 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -894,6 +894,8 @@ void BarUiHistoryPrepend (BarApp_t *app, PianoSong_t *song) {
PianoDestroyPlaylist (delSong);
}
}
+ } else {
+ PianoDestroyPlaylist (song);
}
}