diff --git a/src/blackcore/context/contextaudio.cpp b/src/blackcore/context/contextaudio.cpp index 82711772d..cff31e5df 100644 --- a/src/blackcore/context/contextaudio.cpp +++ b/src/blackcore/context/contextaudio.cpp @@ -231,6 +231,7 @@ namespace BlackCore void CContextAudioBase::gracefulShutdown() { this->terminateVoiceClient(); + m_selcalPlayer->gracefulShutdown(); QObject::disconnect(this); } diff --git a/src/blacksound/selcalplayer.cpp b/src/blacksound/selcalplayer.cpp index f5febd199..9482b71f5 100644 --- a/src/blacksound/selcalplayer.cpp +++ b/src/blacksound/selcalplayer.cpp @@ -24,6 +24,11 @@ namespace BlackSound } CSelcalPlayer::~CSelcalPlayer() + { + this->gracefulShutdown(); + } + + void CSelcalPlayer::gracefulShutdown() { m_threadedPlayer.quitAndWait(); } diff --git a/src/blacksound/selcalplayer.h b/src/blacksound/selcalplayer.h index 4715c2394..7888134cf 100644 --- a/src/blacksound/selcalplayer.h +++ b/src/blacksound/selcalplayer.h @@ -32,6 +32,9 @@ namespace BlackSound //! Destructor virtual ~CSelcalPlayer() override; + //! Stop the player thread + void gracefulShutdown(); + //! Play SELCAL //! \return Time of the played tone BlackMisc::PhysicalQuantities::CTime play(int volume, const BlackMisc::Aviation::CSelcal &selcal);