Merge change 23277 into eclair

* changes:
  Fix issue 2085690: AudioFlinger must properly terminate the input and output threads when destroyed.
This commit is contained in:
Android (Google) Code Review
2009-08-31 09:38:56 -07:00

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;
}
}