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:
parent
6f054a51d8
commit
bb541e9fb2
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user