From ad390fb6f1d96f325174656108476e4f1b0e89fe Mon Sep 17 00:00:00 2001 From: casey langen Date: Sat, 24 Dec 2016 17:31:32 -0800 Subject: [PATCH] Ensure GaplessTransport always detaches from before destroying players. --- src/core/audio/GaplessTransport.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/audio/GaplessTransport.cpp b/src/core/audio/GaplessTransport.cpp index 245c951f7..7830bc8da 100644 --- a/src/core/audio/GaplessTransport.cpp +++ b/src/core/audio/GaplessTransport.cpp @@ -116,7 +116,7 @@ void GaplessTransport::StartWithPlayer(Player* newPlayer) { playingNext = (newPlayer == nextPlayer); if (nextPlayer != nullptr && newPlayer != nextPlayer) { - this->nextPlayer->Destroy(); + RESET_NEXT_PLAYER(this); } RESET_ACTIVE_PLAYER(this); @@ -168,8 +168,7 @@ void GaplessTransport::StopInternal( RESET_NEXT_PLAYER(this); if (this->activePlayer && this->activePlayer != exclude) { - this->activePlayer->Destroy(); - this->activePlayer = nullptr; + RESET_ACTIVE_PLAYER(this); } }