Fix issue 2085690: AudioFlinger must properly terminate the input and output threads when destroyed.

Call closeInput() for all inputs and closeOutput() for all outputs before deleting audio hardware in AudioFlinger destructor.
This commit is contained in:
Eric Laurent
2009-08-28 10:39:03 -07:00
parent 66360af891
commit 7954c46425

View File

@@ -136,8 +136,17 @@ AudioFlinger::AudioFlinger()
AudioFlinger::~AudioFlinger()
{
mRecordThreads.clear();
mPlaybackThreads.clear();
while (!mRecordThreads.isEmpty()) {
// closeInput() will remove first entry from mRecordThreads
closeInput(mRecordThreads.keyAt(0));
}
while (!mPlaybackThreads.isEmpty()) {
// closeOutput() will remove first entry from mPlaybackThreads
closeOutput(mPlaybackThreads.keyAt(0));
}
if (mAudioHardware) {
delete mAudioHardware;
}
}