[whatwg] Define MessagePort.isConnected or MessagePort.ondisconnect

> If you don't need to ever broadcast something to all the ports, you can
> avoid keeping track of the ports altogether, and then you won't have a
> problem. If you do need to broadcast, it's hard not to slowly leak at the
> moment.

Even with the example below, "port" and "port.onmessage" will be
created every time I reload the tab, and they will never be cleaned as
long as I don't close all the pages.

=== <JS> ==
onconnect = function(e) {
  var port = e.ports[0];
  port.onmessage = function() {
    port.postMessage('yes');
  }
}
=== </JS> ==

Received on Monday, 15 March 2010 20:17:18 UTC