Open
Description
It appears there are several cases such as if a peer connection shuts down before it is fully stable or is in the process of renegotiating, that closing it and any of its child structures can result in inconsistent state. This inconsistent state can lead to goroutine leaks but more importantly prevents any kind of reuse of the structures if that were to be desired.
The inconsistency is usually due to a combination of critical sections around a state machine. Given how intricate the interactions of each webrtc component is which can cause its own host of issues if one doesn't do operations to spec, this feels important to audit.