mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 21:58:37 -05:00
BLOCKING_QUEUE: don't forget to cleanup if we try_push()
This commit is contained in:
parent
65c1722bca
commit
3ed65eff8e
@ -298,13 +298,17 @@ void DemodulatorThread::run() {
|
||||
ati_vis->type = 0;
|
||||
}
|
||||
|
||||
//non-blocking push for audio-out
|
||||
localAudioVisOutputQueue->try_push(ati_vis);
|
||||
if (!localAudioVisOutputQueue->try_push(ati_vis)) {
|
||||
//non-blocking push for audio-out
|
||||
ati_vis->setRefCount(0);
|
||||
std::cout << "DemodulatorThread::run() cannot push ati_vis into localAudioVisOutputQueue, is full !" << std::endl;
|
||||
std::this_thread::yield();
|
||||
}
|
||||
}
|
||||
|
||||
if (ati != nullptr) {
|
||||
if (!muted.load() && (!wxGetApp().getSoloMode() || (demodInstance == wxGetApp().getDemodMgr().getLastActiveDemodulator()))) {
|
||||
//non-blocking push for audio-out
|
||||
|
||||
audioOutputQueue->push(ati);
|
||||
} else {
|
||||
ati->setRefCount(0);
|
||||
|
Loading…
Reference in New Issue
Block a user