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

Commit d330e1c1 authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge "AudioFlinger: Close MMap threads in destructor"

parents ede17f72 b4946b6d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -224,6 +224,14 @@ AudioFlinger::~AudioFlinger()
        // closeOutput_nonvirtual() will remove specified entry from mPlaybackThreads
        closeOutput_nonvirtual(mPlaybackThreads.keyAt(0));
    }
    while (!mMmapThreads.isEmpty()) {
        const audio_io_handle_t io = mMmapThreads.keyAt(0);
        if (mMmapThreads.valueAt(0)->isOutput()) {
            closeOutput_nonvirtual(io); // removes entry from mMmapThreads
        } else {
            closeInput_nonvirtual(io);  // removes entry from mMmapThreads
        }
    }

    for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
        // no mHardwareLock needed, as there are no other references to this