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

Commit b4946b6d authored by Andy Hung's avatar Andy Hung
Browse files

AudioFlinger: Close MMap threads in destructor

For aesthetic symmetry.

Test: compiles
Change-Id: I5876409cf0ebf0c1945def19bcfd455d87dd4542
parent 0a2fc30b
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -224,6 +224,14 @@ AudioFlinger::~AudioFlinger()
        // closeOutput_nonvirtual() will remove specified entry from mPlaybackThreads
        // closeOutput_nonvirtual() will remove specified entry from mPlaybackThreads
        closeOutput_nonvirtual(mPlaybackThreads.keyAt(0));
        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++) {
    for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
        // no mHardwareLock needed, as there are no other references to this
        // no mHardwareLock needed, as there are no other references to this