Re: [Bug 25724] New: Allow garbage collection of closed PeerConnections

On 5/15/14 6:21 AM, bugzilla@jessica.w3.org wrote:
> 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".

How about:

A Window object has a weak reference to RTCPeerConnection objects created
from the constructor whose global object is that Window object, and whose
RTCSignalingState is not "closed".


That's effectively what Firefox has, e.g. PCs may be garbage collected 
if the JS drops all references to them.

.: Jan-Ivar :.

Received on Thursday, 15 May 2014 20:11:35 UTC