1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

AudioOutput: fixed core dump on program exit

This commit is contained in:
f4exb 2016-10-08 06:54:49 +02:00
parent 6f054a51d8
commit bb541e9fb2
3 changed files with 9 additions and 1 deletions

View File

@ -26,6 +26,7 @@ AudioOutput::AudioOutput() :
m_mutex(),
m_audioOutput(0),
m_audioUsageCount(0),
m_onExit(false),
m_audioFifos()
{
}
@ -124,7 +125,10 @@ void AudioOutput::stop()
if (m_audioUsageCount == 0)
{
QIODevice::close();
delete m_audioOutput;
if (!m_onExit) {
delete m_audioOutput;
}
}
}
}

View File

@ -41,11 +41,13 @@ public:
void removeFifo(AudioFifo* audioFifo);
uint getRate() const { return m_audioFormat.sampleRate(); }
void setOnExit(bool onExit) { m_onExit = onExit; }
private:
QMutex m_mutex;
QAudioOutput* m_audioOutput;
uint m_audioUsageCount;
bool m_onExit;
typedef std::list<AudioFifo*> AudioFifos;
AudioFifos m_audioFifos;

View File

@ -28,6 +28,8 @@ DSPEngine::DSPEngine() :
DSPEngine::~DSPEngine()
{
m_audioOutput.setOnExit(true);
std::vector<DSPDeviceSourceEngine*>::iterator it = m_deviceEngines.begin();
while (it != m_deviceEngines.end())