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

Commit d0d3cc9f authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "AudioFlinger: Ensure RecordTrack dtor called outside lock" into main am: 9629da70

parents b97e7d63 9629da70
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -8254,6 +8254,7 @@ reacquire_wakelock:
    for (int64_t loopCount = 0;; ++loopCount) {  // loopCount used for statistics tracking
        // Note: these sp<> are released at the end of the for loop outside of the mutex() lock.
        sp<IAfRecordTrack> activeTrack;
        std::vector<sp<IAfRecordTrack>> oldActiveTracks;
        Vector<sp<IAfEffectChain>> effectChains;

        // activeTracks accumulates a copy of a subset of mActiveTracks
@@ -8303,7 +8304,9 @@ reacquire_wakelock:
            bool doBroadcast = false;
            bool allStopped = true;
            for (size_t i = 0; i < size; ) {

                if (activeTrack) {  // ensure track release is outside lock.
                    oldActiveTracks.emplace_back(std::move(activeTrack));
                }
                activeTrack = mActiveTracks[i];
                if (activeTrack->isTerminated()) {
                    if (activeTrack->isFastTrack()) {