Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52efda85 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 23277 into eclair

* changes:
  Fix issue 2085690: AudioFlinger must properly terminate the input and output threads when destroyed.
parents 87bd2160 c80b1a00
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -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;
    }
}