mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 13:48:38 -05:00
OSX crash-on-exit fix
This commit is contained in:
parent
f1355b1775
commit
234f0783a0
@ -74,10 +74,6 @@ int CubicSDR::OnExit() {
|
|||||||
|
|
||||||
demodMgr.terminateAll();
|
demodMgr.terminateAll();
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
AudioThread::deviceCleanup();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
delete threadCmdQueueSDR;
|
delete threadCmdQueueSDR;
|
||||||
|
|
||||||
delete iqVisualQueue;
|
delete iqVisualQueue;
|
||||||
@ -86,6 +82,11 @@ int CubicSDR::OnExit() {
|
|||||||
|
|
||||||
delete m_glContext;
|
delete m_glContext;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
AudioThread::deviceCleanup();
|
||||||
|
#endif
|
||||||
|
|
||||||
return wxApp::OnExit();
|
return wxApp::OnExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,11 @@ static int audioCallback(void *outputBuffer, void *inputBuffer, unsigned int nBu
|
|||||||
AudioThread *src = (AudioThread *) userData;
|
AudioThread *src = (AudioThread *) userData;
|
||||||
float *out = (float*) outputBuffer;
|
float *out = (float*) outputBuffer;
|
||||||
memset(out, 0, nBufferFrames * 2 * sizeof(float));
|
memset(out, 0, nBufferFrames * 2 * sizeof(float));
|
||||||
|
|
||||||
|
if (src->terminated) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
std::cout << "Audio buffer underflow.." << (src->underflowCount++) << std::endl;
|
std::cout << "Audio buffer underflow.." << (src->underflowCount++) << std::endl;
|
||||||
}
|
}
|
||||||
@ -383,8 +388,10 @@ void AudioThread::threadMain() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !__APPLE__
|
||||||
AudioThreadInput dummy;
|
AudioThreadInput dummy;
|
||||||
inputQueue->push(&dummy);
|
inputQueue->push(&dummy);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
if (deviceController[parameters.deviceId] != this) {
|
if (deviceController[parameters.deviceId] != this) {
|
||||||
|
Loading…
Reference in New Issue
Block a user