diff --git a/src/queue/PlaylistEdit.cxx b/src/queue/PlaylistEdit.cxx index 64f8ccd81..becaf1622 100644 --- a/src/queue/PlaylistEdit.cxx +++ b/src/queue/PlaylistEdit.cxx @@ -33,6 +33,8 @@ #include "SongLoader.hxx" #include "Idle.hxx" +#include + #include void @@ -128,14 +130,11 @@ playlist::AppendURI(PlayerControl &pc, const SongLoader &loader, const char *uri, Error &error) { - DetachedSong *song = loader.LoadSong(uri, error); + std::unique_ptr song(loader.LoadSong(uri, error)); if (song == nullptr) return 0; - unsigned result = AppendSong(pc, std::move(*song), error); - delete song; - - return result; + return AppendSong(pc, std::move(*song), error); } void