Skip to content
Browse files

Fix history memory leak

With `history = 0` playlist items are discarded, but not freed.
  • Loading branch information...
1 parent 5b2a121 commit e3d8f497baaf02daeddb060cd986681d0ee208de @PromyLOPh committed Sep 17, 2012
Showing with 3 additions and 0 deletions.
  1. +1 −0 src/main.c
  2. +2 −0 src/ui.c
View
1 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) {
View
2 src/ui.c
@@ -894,6 +894,8 @@ void BarUiHistoryPrepend (BarApp_t *app, PianoSong_t *song) {
PianoDestroyPlaylist (delSong);
}
}
+ } else {
+ PianoDestroyPlaylist (song);
}
}

0 comments on commit e3d8f49

Please sign in to comment.
Something went wrong with that request. Please try again.