Re: [whatwg/dom] Disposable AbortController (Issue #1405)

keithamus left a comment (whatwg/dom#1405)

Sounds like there is perhaps a request for two levels of disposability then?

1. To consider an AbortController "closed" or "past the point of no return" whereby it frees up the associated callbacks because it knows it won't call them, and then also presumably throws if `abort()` is called.
2. To consider an AbortController "aborted" where it does the usual abort steps.

I can acknowledge the desire for 1 but it seems problematic for event cases on long lived DOM objects. If attach a bunch of event listeners and your only way to free them is to abort, accidentally closing your AbortController is effectively like forcing a leak on the event listeners. 

I'd perhaps make the case that `using AbortController()` should follow case 2, and for Ron's case of closing an abort controller, if we go that route, we can add a `using AbortController().ButItClosesAndDoesntAbortSoBeCareful()`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1405#issuecomment-3350492906
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1405/3350492906@github.com>

Received on Tuesday, 30 September 2025 07:56:55 UTC