W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2010

[whatwg] Define MessagePort.isConnected or MessagePort.ondisconnect

From: ATSUSHI TAKAYAMA <taka.atsushi@googlemail.com>
Date: Mon, 15 Mar 2010 23:17:18 -0400
Message-ID: <9cef076f1003152017u77fc3388h9fcbd13888695047@mail.gmail.com>
> 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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:21 UTC