decoder/Control: wrap DetachedSong* in std::unique_ptr
This commit is contained in:
@@ -38,8 +38,6 @@ DecoderControl::DecoderControl(Mutex &_mutex, Cond &_client_cond,
|
||||
DecoderControl::~DecoderControl() noexcept
|
||||
{
|
||||
ClearError();
|
||||
|
||||
delete song;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -92,7 +90,7 @@ DecoderControl::IsCurrentSong(const DetachedSong &_song) const noexcept
|
||||
}
|
||||
|
||||
void
|
||||
DecoderControl::Start(DetachedSong *_song,
|
||||
DecoderControl::Start(std::unique_ptr<DetachedSong> _song,
|
||||
SongTime _start_time, SongTime _end_time,
|
||||
MusicBuffer &_buffer, MusicPipe &_pipe) noexcept
|
||||
{
|
||||
@@ -101,8 +99,7 @@ DecoderControl::Start(DetachedSong *_song,
|
||||
assert(_song != nullptr);
|
||||
assert(_pipe.IsEmpty());
|
||||
|
||||
delete song;
|
||||
song = _song;
|
||||
song = std::move(_song);
|
||||
start_time = _start_time;
|
||||
end_time = _end_time;
|
||||
buffer = &_buffer;
|
||||
|
||||
Reference in New Issue
Block a user