player/Control: wrap DetachedSong* in std::unique_ptr
This commit is contained in:
@@ -56,7 +56,7 @@ playlist::QueueSongOrder(PlayerControl &pc, unsigned order)
|
||||
FormatDebug(playlist_domain, "queue song %i:\"%s\"",
|
||||
queued, song.GetURI());
|
||||
|
||||
pc.LockEnqueueSong(new DetachedSong(song));
|
||||
pc.LockEnqueueSong(std::make_unique<DetachedSong>(song));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -163,7 +163,7 @@ playlist::PlayOrder(PlayerControl &pc, unsigned order)
|
||||
|
||||
current = order;
|
||||
|
||||
pc.Play(new DetachedSong(song));
|
||||
pc.Play(std::make_unique<DetachedSong>(song));
|
||||
|
||||
SongStarted();
|
||||
}
|
||||
|
@@ -234,7 +234,7 @@ playlist::SeekSongOrder(PlayerControl &pc, unsigned i, SongTime seek_time)
|
||||
queued = -1;
|
||||
|
||||
try {
|
||||
pc.LockSeek(new DetachedSong(queue.GetOrder(i)), seek_time);
|
||||
pc.LockSeek(std::make_unique<DetachedSong>(queue.GetOrder(i)), seek_time);
|
||||
} catch (...) {
|
||||
UpdateQueuedSong(pc, queued_song);
|
||||
throw;
|
||||
|
Reference in New Issue
Block a user