From 8c3e1b2df1be1af6ba22c1639a3431e29e627ce9 Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Sat, 10 Aug 2024 08:26:11 +0200 Subject: [PATCH] Fix reserve in iterateRemoteTracks() --- src/impl/peerconnection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/impl/peerconnection.cpp b/src/impl/peerconnection.cpp index aee3906f7..a6515446e 100644 --- a/src/impl/peerconnection.cpp +++ b/src/impl/peerconnection.cpp @@ -836,7 +836,7 @@ void PeerConnection::iterateRemoteTracks(std::function tr std::vector> locked; { std::shared_lock lock(mTracksMutex); // read-only - locked.reserve(mTracks.size()); + locked.reserve(remote->mediaCount()); for(int i = 0; i < remote->mediaCount(); ++i) { if (std::holds_alternative(remote->media(i))) { auto remoteMedia = std::get(remote->media(i));