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

Commit 08209921 authored by jiabin's avatar jiabin Committed by Android Build Cherrypicker Worker
Browse files

Destroy output tracks when existing.

Bug: 364404031
Test: manually
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c62d60305b1b674960a2628e01d1f3d3f509d405)
Merged-In: I4e83ee6d7cca38c62448ccb3019a7d2275cc664e
Change-Id: I4e83ee6d7cca38c62448ccb3019a7d2275cc664e
parent cc1d52cd
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -7760,6 +7760,9 @@ void DuplicatingThread::threadLoop_exit()
        audio_utils::lock_guard l(mutex());
        audio_utils::lock_guard l(mutex());
        localTracks = std::move(mOutputTracks);
        localTracks = std::move(mOutputTracks);
        mOutputTracks.clear();
        mOutputTracks.clear();
        for (size_t i = 0; i < localTracks.size(); ++i) {
            localTracks[i]->destroy();
        }
    }
    }
    localTracks.clear();
    localTracks.clear();
    outputTracks.clear();
    outputTracks.clear();