Skip to content

Commit 4a2f9c6

Browse files
committed
fix: switch to iterator based loop
1 parent 3809e90 commit 4a2f9c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioNodeManager.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ void AudioNodeManager::settlePendingConnections() {
7272
assert(to != nullptr);
7373
from->disconnectNode(to);
7474
} else {
75-
auto outputNodesCopy = from->outputNodes_;
76-
for (auto &node : outputNodesCopy) {
77-
from->disconnectNode(node);
75+
for (auto it = from->outputNodes_.begin(); it != from->outputNodes_.end();) {
76+
auto next = std::next(it);
77+
from->disconnectNode(*it);
78+
it = next;
7879
}
7980
}
8081
}

0 commit comments

Comments
 (0)