Signaling abort on an AbortSignal should immediately clear out the follower list
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox84 | --- | fixed |
People
(Reporter: Waldo, Assigned: Waldo)
References
()
Details
Attachments
(1 file)
Signaling abort is supposed to empty out the signal's algorithms list. We don't do that right now, so a signal that's been aborted unnecessarily extends the lifetime of a bunch of unused data. We should follow the spec and clear this earlier. (This is only visible as keeping stuff alive too long -- no semantically visible change except in GC behavior.)
The set of patches in bug 1660555, at end, had a memory leak that I thought might possibly be this one. It doesn't appear that was the case. But we should do this regardless, and it's one less explanation of the leak to have to consider.
This operation could be implemented by calling Unfollow() on every follower. But that would mean individually removing each follower from the followers array and shifting array contents accordingly -- which would be quadratic. Instead, we should directly access the array and clear the links in each direction manually. (The signal->follower link isn't strong until bug 1660555 is complete, so clearing that is belt-and-suspenders for the moment.) And at that point, IMO it seems best for adding/removing to do so by direct access (and visibly paired modifying of the bidirectional links) as well, which proposed change was previously rejected on its own in bug 1660555.
| Assignee | ||
Comment 1•5 years ago
|
||
Comment 3•5 years ago
|
||
| bugherder | ||
Description
•