- From: Jake Archibald <notifications@github.com>
- Date: Thu, 04 Feb 2021 06:57:52 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 4 February 2021 14:58:05 UTC
> You can forget to remove the listener correctly when the resource is finished and leak memory. Just to clarify, the resource only stays in memory until `signal` is GC'd, at which point [it's all collected](https://jakearchibald.com/2020/events-and-gc/). > One alternative suggested was to have a utility method that helps with this, the above code bemes: > > ```js > // the second parameter is so the listener is removed when the resource gets GCd. > aborted(signal, resource).then(() => resource.cleanup()); > ``` What mechanism is it using for that? Weakrefs? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/946#issuecomment-773371280
Received on Thursday, 4 February 2021 14:58:05 UTC