Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2696 introduced removing datachannels from the sctptransport for better garbage collection. That PR introduced a race condition for data channels created before connection establishment. When an out of band negotiated data channel, created before peerconnection establishment is detached, there's a race between the data channel being removed from `r.dataChannels` and it being copied in to the existing data channel slice in the acceptDataChannels goroutine. This PR fixes this race by copying the slice before any datachannels could be detached.
- Loading branch information