mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
unsubscribe invalid ToxCall from audio when copied
This commit is contained in:
parent
d8607324ce
commit
27bfade9e1
|
@ -46,6 +46,12 @@ ToxCall::ToxCall(ToxCall&& other) noexcept
|
|||
other.callId = numeric_limits<decltype(callId)>::max();
|
||||
other.alSource = 0;
|
||||
|
||||
Audio& audio = Audio::getInstance();
|
||||
audio.subscribeInput(this);
|
||||
audio.unsubscribeInput(&other);
|
||||
audio.subscribeOutput(this);
|
||||
audio.unsubscribeOutput(&other);
|
||||
|
||||
#ifdef QTOX_FILTER_AUDIO
|
||||
filterer = other.filterer;
|
||||
other.filterer = nullptr;
|
||||
|
@ -54,18 +60,20 @@ ToxCall::ToxCall(ToxCall&& other) noexcept
|
|||
|
||||
ToxCall::~ToxCall()
|
||||
{
|
||||
if (alSource)
|
||||
Audio::getInstance().deleteSource(alSource);
|
||||
Audio& audio = Audio::getInstance();
|
||||
|
||||
if (sendAudioTimer)
|
||||
{
|
||||
QObject::disconnect(sendAudioTimer, nullptr, nullptr, nullptr);
|
||||
sendAudioTimer->stop();
|
||||
Audio& audio = Audio::getInstance();
|
||||
audio.unsubscribeInput(this);
|
||||
audio.unsubscribeOutput(this);
|
||||
}
|
||||
|
||||
if (alSource)
|
||||
audio.deleteSource(alSource);
|
||||
|
||||
audio.unsubscribeInput(this);
|
||||
audio.unsubscribeOutput(this);
|
||||
|
||||
#ifdef QTOX_FILTER_AUDIO
|
||||
if (filterer)
|
||||
delete filterer;
|
||||
|
|
Loading…
Reference in New Issue
Block a user