diff options
| author | 2009-08-28 10:39:03 -0700 | |
|---|---|---|
| committer | 2009-08-31 02:10:20 -0700 | |
| commit | c80b1a0034eaf41779ee6c254cb7de00484549a6 (patch) | |
| tree | fb2dffa55344227014d5efb95c904021c54f40da /libs/audioflinger/AudioFlinger.cpp | |
| parent | 392f61b0fcd87f672f1f7a7a2234e60f9fc71039 (diff) | |
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.
Diffstat (limited to 'libs/audioflinger/AudioFlinger.cpp')
| -rw-r--r-- | libs/audioflinger/AudioFlinger.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp index 77a126c724..3a419b579b 100644 --- a/libs/audioflinger/AudioFlinger.cpp +++ b/libs/audioflinger/AudioFlinger.cpp @@ -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; + } } |