aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/PlaylistEdit.cxx6
-rw-r--r--src/QueueSave.cxx2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/PlaylistEdit.cxx b/src/PlaylistEdit.cxx
index 3cb68a1ab..9ef671a19 100644
--- a/src/PlaylistEdit.cxx
+++ b/src/PlaylistEdit.cxx
@@ -64,7 +64,9 @@ playlist::AppendFile(struct player_control &pc,
if (song == nullptr)
return PLAYLIST_RESULT_NO_SUCH_SONG;
- return AppendSong(pc, song, added_id);
+ const auto result = AppendSong(pc, song, added_id);
+ song->Free();
+ return result;
}
enum playlist_result
@@ -125,6 +127,8 @@ playlist::AppendURI(struct player_control &pc,
enum playlist_result result = AppendSong(pc, song, added_id);
if (db != nullptr)
db->ReturnSong(song);
+ else
+ song->Free();
return result;
}
diff --git a/src/QueueSave.cxx b/src/QueueSave.cxx
index 7fe985a69..c45390097 100644
--- a/src/QueueSave.cxx
+++ b/src/QueueSave.cxx
@@ -128,4 +128,6 @@ queue_load_song(TextFile &file, const char *line, queue *queue)
if (db != nullptr)
db->ReturnSong(song);
+ else
+ song->Free();
}