mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-02-03 09:44:26 -05: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) {
|
||||
DemodulatorThreadCommand tCmd(DemodulatorThreadCommand::DEMOD_THREAD_CMD_AUDIO_TERMINATED);
|
||||
tCmd.context = this;
|
||||
@ -421,14 +429,6 @@ void AudioThread::terminate() {
|
||||
terminated = true;
|
||||
AudioThreadCommand endCond; // push an empty input to bump the queue
|
||||
cmdQueue.push(endCond);
|
||||
|
||||
while (!inputQueue->empty()) { // flush queue
|
||||
AudioThreadInput *dummy;
|
||||
inputQueue->pop(dummy);
|
||||
if (dummy) {
|
||||
dummy->decRefCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool AudioThread::isActive() {
|
||||
|
@ -173,7 +173,7 @@ void DemodulatorThread::run() {
|
||||
}
|
||||
}
|
||||
} else if (ati) {
|
||||
ati->decRefCount();
|
||||
ati->setRefCount(0);
|
||||
ati = nullptr;
|
||||
}
|
||||
|
||||
@ -279,24 +279,23 @@ void DemodulatorThread::run() {
|
||||
|
||||
// Purge any unused inputs
|
||||
while (!iqInputQueue->empty()) {
|
||||
DemodulatorThreadPostIQData *inp;
|
||||
iqInputQueue->pop(inp);
|
||||
inp->setRefCount(0);
|
||||
DemodulatorThreadPostIQData *ref;
|
||||
iqInputQueue->pop(ref);
|
||||
if (ref) {
|
||||
ref->setRefCount(0);
|
||||
}
|
||||
}
|
||||
while (!audioOutputQueue->empty()) {
|
||||
AudioThreadInput *ati;
|
||||
audioOutputQueue->pop(ati);
|
||||
ati->setRefCount(0);
|
||||
AudioThreadInput *ref;
|
||||
audioOutputQueue->pop(ref);
|
||||
if (ref) {
|
||||
ref->setRefCount(0);
|
||||
}
|
||||
}
|
||||
outputBuffers.purge();
|
||||
|
||||
//Guard the cleanup of audioVisOutputQueue properly.
|
||||
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);
|
||||
tCmd.context = this;
|
||||
|
Loading…
Reference in New Issue
Block a user