MusicPipe: automatically clear in destructor

We can implement this now that we have a MusicBuffer reference.
This commit is contained in:
Max Kellermann
2018-06-22 23:09:13 +02:00
parent 9f14e7a98d
commit e81b089612
3 changed files with 8 additions and 23 deletions

View File

@@ -169,14 +169,9 @@ private:
xfade_state = CrossFadeState::UNKNOWN;
}
void ClearAndDeletePipe() noexcept {
pipe->Clear();
delete pipe;
}
void ClearAndReplacePipe(MusicPipe *_pipe) noexcept {
ResetCrossFade();
ClearAndDeletePipe();
delete pipe;
pipe = _pipe;
}
@@ -1070,7 +1065,7 @@ Player::Run() noexcept
CancelPendingSeek();
StopDecoder();
ClearAndDeletePipe();
delete pipe;
cross_fade_tag.reset();