From fe9a34905b79f7daa0bccc8901c44b7245f09628 Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Mon, 22 Feb 2021 09:49:03 +0100 Subject: [PATCH] Fixed missing data channels mutex lock --- src/peerconnection.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/peerconnection.cpp b/src/peerconnection.cpp index 3dc9f1a..4ced150 100644 --- a/src/peerconnection.cpp +++ b/src/peerconnection.cpp @@ -667,6 +667,8 @@ void PeerConnection::forwardMessage(message_ptr message) { stream); channel->onOpen(weak_bind(&PeerConnection::triggerDataChannel, this, weak_ptr{channel})); + + std::unique_lock lock(mDataChannelsMutex); // we are going to emplace mDataChannels.emplace(stream, channel); } else { // Invalid, close the DataChannel