AudioFlinger: Ensure RecordTrack dtor called outside lock (pt 2)
Update RecordThread activeTrack handling.
Flag: EXEMPT bugfix
Test: atest AudioRecordTest
Bug: 329604636
Change-Id: I365ce3a63b2033325b659d60a3557db3c52e6575
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 66e89e4..66ec2ba 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -8670,6 +8670,9 @@
// loop over each active track
for (size_t i = 0; i < size; i++) {
+ if (activeTrack) { // ensure track release is outside lock.
+ oldActiveTracks.emplace_back(std::move(activeTrack));
+ }
activeTrack = activeTracks[i];
// skip fast tracks, as those are handled directly by FastCapture