Fixed missing data channels mutex lock

This commit is contained in:
Paul-Louis Ageneau
2021-02-22 09:49:03 +01:00
parent b88f1f5e72
commit fe9a34905b

View File

@ -667,6 +667,8 @@ void PeerConnection::forwardMessage(message_ptr message) {
stream);
channel->onOpen(weak_bind(&PeerConnection::triggerDataChannel, this,
weak_ptr<DataChannel>{channel}));
std::unique_lock lock(mDataChannelsMutex); // we are going to emplace
mDataChannels.emplace(stream, channel);
} else {
// Invalid, close the DataChannel