This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: https://html.spec.whatwg.org/multipage/comms.html Multipage: https://html.spec.whatwg.org/multipage/#message-ports Complete: https://html.spec.whatwg.org/#message-ports Referrer: https://www.google.com/ Comment: There's no way to tell when a MessagePort is closed. If we amend the close method of a MessagePort to send a "close" event to its entangled partner (and ensure that when a browser tab is closed, all its open message ports are closed) then the programmer using a MessagePort can handle this event and remove the reference to the MessagePort. This is a much nicer solution than the PortCollection. Sure, it can leak memory if the programmer doesn't handle the callback and remove the reference, but this is easy to document and understand. Posted from: 204.14.159.168 User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36
Wouldn't you be able to observe garbage collection with this solution as well?
https://lists.w3.org/Archives/Public/public-whatwg-archive/2013Oct/thread.html#msg3 has more detail on this discussion.
https://github.com/whatwg/html/issues/1766