playlist/SongEnumerator: wrap song in std::unique_ptr

This commit is contained in:
Max Kellermann
2016-02-07 08:23:30 +01:00
parent e2a0fd7a28
commit 1c5f76635a
13 changed files with 33 additions and 38 deletions

View File

@@ -20,13 +20,13 @@
#include "config.h"
#include "MemorySongEnumerator.hxx"
DetachedSong *
std::unique_ptr<DetachedSong>
MemorySongEnumerator::NextSong()
{
if (songs.empty())
return nullptr;
auto result = new DetachedSong(std::move(songs.front()));
std::unique_ptr<DetachedSong> result(new DetachedSong(std::move(songs.front())));
songs.pop_front();
return result;
}