SongSave: wrap DetachedSong* in std::unique_ptr

This commit is contained in:
Max Kellermann
2017-11-26 12:18:31 +01:00
parent 28fdf1e9ed
commit 75582d47b9
4 changed files with 9 additions and 15 deletions

View File

@@ -160,11 +160,10 @@ directory_load(TextFile &file, Directory &directory)
if (directory.FindSong(name) != nullptr)
throw FormatRuntimeError("Duplicate song '%s'", name);
DetachedSong *song = song_load(file, name);
auto song = song_load(file, name);
directory.AddSong(Song::NewFrom(std::move(*song),
directory));
delete song;
} else if ((p = StringAfterPrefix(line, PLAYLIST_META_BEGIN))) {
const char *name = p;
playlist_metadata_load(file, directory.playlists, name);