Merge pull request #41 from Xele02/master

[Qt-desktop] Correct audio crash on exit
This commit is contained in:
Henrik Rydgård 2013-02-01 00:16:43 -08:00
commit a18fbd0bcc

View file

@ -161,11 +161,11 @@ public:
output = new QAudioOutput(fmt); output = new QAudioOutput(fmt);
output->setBufferSize(mixlen); output->setBufferSize(mixlen);
feed = output->start(); feed = output->start();
startTimer(1000*AUDIO_SAMPLES / AUDIO_FREQ); timer = startTimer(1000*AUDIO_SAMPLES / AUDIO_FREQ);
} }
~MainAudio() { ~MainAudio() {
killTimer(timer);
feed->close(); feed->close();
delete feed;
output->stop(); output->stop();
delete output; delete output;
free(mixbuf); free(mixbuf);
@ -182,6 +182,7 @@ private:
QAudioOutput* output; QAudioOutput* output;
int mixlen; int mixlen;
char* mixbuf; char* mixbuf;
int timer;
}; };
#endif #endif