W3C home > Mailing lists > Public > public-webrtc@w3.org > March 2014

Re: Improvements suggestion for DataChannels

From: Randell Jesup <randell-ietf@jesup.org>
Date: Mon, 03 Mar 2014 09:15:08 -0500
Message-ID: <53148E6C.5050907@jesup.org>
To: public-webrtc@w3.org
On 3/3/2014 8:06 AM, Martin Thomson wrote:
> On 3 March 2014 04:18, Adam Bergkvist <adam.bergkvist@ericsson.com> wrote:
>> I still think that's strange API behavior.
> I don't see any strangeness here.  If I have a reference, then the
> object is not garbage collected.  If not, then not.
>

Agree with Martin.  It seems totally normal - things stay alive 
(accessible) so long as they're referenced.  Telling it to close() 
disconnects it, but the object exists so long as the reference exists.

The only way that channel lifetimes are a little bit surprising is that 
open channels (like in WebSockets) stay alive so long as their 
onmessage/etc handlers have functions attached to them, depending on state.
http://dev.w3.org/html5/websockets/#garbage-collection
And we have the same issues.
http://dev.w3.org/2011/webrtc/editor/webrtc.html#garbage-collection-1

So if someone is holding a reference, the channel can be closed.  If 
it's closed, then when you drop the reference it will be GC'd (when the 
system feels like).

-- 
Randell Jesup -- rjesup a t mozilla d o t com
Received on Monday, 3 March 2014 14:17:01 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:38 UTC