mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-04 22:27:49 -04:00
Trying.. still one stuck in the queue on delete..
This commit is contained in:
parent
50bfb251f8
commit
2bdefca263
@ -409,6 +409,14 @@ void AudioThread::run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (!inputQueue->empty()) { // flush queue
|
||||||
|
AudioThreadInput *dummy;
|
||||||
|
inputQueue->pop(dummy);
|
||||||
|
if (dummy) {
|
||||||
|
dummy->setRefCount(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (threadQueueNotify != NULL) {
|
if (threadQueueNotify != NULL) {
|
||||||
DemodulatorThreadCommand tCmd(DemodulatorThreadCommand::DEMOD_THREAD_CMD_AUDIO_TERMINATED);
|
DemodulatorThreadCommand tCmd(DemodulatorThreadCommand::DEMOD_THREAD_CMD_AUDIO_TERMINATED);
|
||||||
tCmd.context = this;
|
tCmd.context = this;
|
||||||
@ -421,14 +429,6 @@ void AudioThread::terminate() {
|
|||||||
terminated = true;
|
terminated = true;
|
||||||
AudioThreadCommand endCond; // push an empty input to bump the queue
|
AudioThreadCommand endCond; // push an empty input to bump the queue
|
||||||
cmdQueue.push(endCond);
|
cmdQueue.push(endCond);
|
||||||
|
|
||||||
while (!inputQueue->empty()) { // flush queue
|
|
||||||
AudioThreadInput *dummy;
|
|
||||||
inputQueue->pop(dummy);
|
|
||||||
if (dummy) {
|
|
||||||
dummy->decRefCount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioThread::isActive() {
|
bool AudioThread::isActive() {
|
||||||
|
@ -173,7 +173,7 @@ void DemodulatorThread::run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (ati) {
|
} else if (ati) {
|
||||||
ati->decRefCount();
|
ati->setRefCount(0);
|
||||||
ati = nullptr;
|
ati = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,24 +279,23 @@ void DemodulatorThread::run() {
|
|||||||
|
|
||||||
// Purge any unused inputs
|
// Purge any unused inputs
|
||||||
while (!iqInputQueue->empty()) {
|
while (!iqInputQueue->empty()) {
|
||||||
DemodulatorThreadPostIQData *inp;
|
DemodulatorThreadPostIQData *ref;
|
||||||
iqInputQueue->pop(inp);
|
iqInputQueue->pop(ref);
|
||||||
inp->setRefCount(0);
|
if (ref) {
|
||||||
|
ref->setRefCount(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while (!audioOutputQueue->empty()) {
|
while (!audioOutputQueue->empty()) {
|
||||||
AudioThreadInput *ati;
|
AudioThreadInput *ref;
|
||||||
audioOutputQueue->pop(ati);
|
audioOutputQueue->pop(ref);
|
||||||
ati->setRefCount(0);
|
if (ref) {
|
||||||
|
ref->setRefCount(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
outputBuffers.purge();
|
outputBuffers.purge();
|
||||||
|
|
||||||
//Guard the cleanup of audioVisOutputQueue properly.
|
//Guard the cleanup of audioVisOutputQueue properly.
|
||||||
std::lock_guard < std::mutex > lock(m_mutexAudioVisOutputQueue);
|
std::lock_guard < std::mutex > lock(m_mutexAudioVisOutputQueue);
|
||||||
|
|
||||||
// if (audioVisOutputQueue != nullptr && !audioVisOutputQueue->empty()) {
|
|
||||||
// AudioThreadInput *dummy_vis;
|
|
||||||
// audioVisOutputQueue->pop(dummy_vis);
|
|
||||||
// }
|
|
||||||
|
|
||||||
DemodulatorThreadCommand tCmd(DemodulatorThreadCommand::DEMOD_THREAD_CMD_DEMOD_TERMINATED);
|
DemodulatorThreadCommand tCmd(DemodulatorThreadCommand::DEMOD_THREAD_CMD_DEMOD_TERMINATED);
|
||||||
tCmd.context = this;
|
tCmd.context = this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user