am f7c7a67d: Merge change 23277 into eclair

Merge commit 'f7c7a67d9b223f92e1884a82d49714cb71ee7d37' into eclair-plus-aosp

* commit 'f7c7a67d9b223f92e1884a82d49714cb71ee7d37':
  Fix issue 2085690: AudioFlinger must properly terminate the input and output threads when destroyed.
This commit is contained in:
Eric Laurent
2009-08-31 09:40:50 -07:00
committed by Android Git Automerger

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