forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
events: remove the abort listener on iterator completion
Given an AbortSignal when passed into the events.on AsyncIterator API the attached abort listener should always be removed when the iterator completes. The abortHandler function is declared within the scope of the events.on function so cannot be removed by the caller which can lead to a memory leak. Adding the abort listener using the addEventListener helper returned by the listenersController helper adds the abort listener to the array of listeners that will be cleaned up by removeAll in the closeHandler for the AsyncIterator. Fixes: nodejs#51010
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters