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.callId = numeric_limits<decltype(callId)>::max();
|
||||||
other.alSource = 0;
|
other.alSource = 0;
|
||||||
|
|
||||||
|
Audio& audio = Audio::getInstance();
|
||||||
|
audio.subscribeInput(this);
|
||||||
|
audio.unsubscribeInput(&other);
|
||||||
|
audio.subscribeOutput(this);
|
||||||
|
audio.unsubscribeOutput(&other);
|
||||||
|
|
||||||
#ifdef QTOX_FILTER_AUDIO
|
#ifdef QTOX_FILTER_AUDIO
|
||||||
filterer = other.filterer;
|
filterer = other.filterer;
|
||||||
other.filterer = nullptr;
|
other.filterer = nullptr;
|
||||||
|
@ -54,18 +60,20 @@ ToxCall::ToxCall(ToxCall&& other) noexcept
|
||||||
|
|
||||||
ToxCall::~ToxCall()
|
ToxCall::~ToxCall()
|
||||||
{
|
{
|
||||||
if (alSource)
|
Audio& audio = Audio::getInstance();
|
||||||
Audio::getInstance().deleteSource(alSource);
|
|
||||||
|
|
||||||
if (sendAudioTimer)
|
if (sendAudioTimer)
|
||||||
{
|
{
|
||||||
QObject::disconnect(sendAudioTimer, nullptr, nullptr, nullptr);
|
QObject::disconnect(sendAudioTimer, nullptr, nullptr, nullptr);
|
||||||
sendAudioTimer->stop();
|
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
|
#ifdef QTOX_FILTER_AUDIO
|
||||||
if (filterer)
|
if (filterer)
|
||||||
delete filterer;
|
delete filterer;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user