This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
At the moment, the webrtc specification says: 4.3.3 Garbage collection A Window object has a strong reference to any RTCPeerConnection objects created from the constructor whose global object is that Window object. In other words, RTCPeerConnections can't be garbage collected. In certain applications, where a lot of connections are created, used and closed, this is a Bad Thing, since you can't get rid of old, closed PeerConnections, and you can't reuse them either (there's no return from the "closed" state). Proposal 1: Replace the text with: A Window object has a strong reference to any RTCPeerConnection objects created from the constructor whose global object is that Window object, and whose RTCSignalingState is not "closed". Proposal 2 (less artificial): An RTCPeerConnection is considered to have a strong reference to it from the Window object that was the global object of the constructor as long as any event can cause a handler to be triggered on the object. When the RTCSignalingState is "closed", no such handler can be triggered. In either proposal, it might be good to add: All RTCDTMFSender objects, RTCDataChannel objects and MediaStreamTrack objects that are connected to a PeerConnection are considered to have a strong reference to the PeerConnection object.
There seems to be consensus that garbage collection of PeerConnections that are not in use in any way should happen. I suggest that Adam (or someone else, assigning to Adam as a marker that this is ready for editors to edit) formulate text that says that; proposal 2 above with addendum seems like an OK starting point.
Proposed fix: https://github.com/fluffy/webrtc-w3c/commit/e8b84dbc739279ab4b4d30f8a8d9c4e500638dcb