Repository navigation
Conversation
addEventListener() with a signal registers an abort listener on the signal that was never removed when the event listener was removed by other means (removeEventListener(), a once listener firing, removeAllListeners(), weak listener cleanup). Every add/remove cycle on a long-lived signal left one more abort listener behind, slowing down later add/remove calls on that signal. Keep the abort listener and a weak reference to the signal on the Listener and detach it when the listener is removed. Assisted-by: claude:opus-5.5 Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67501 +/- ##
==========================================
- Coverage 90.66% 90.66% -0.01%
==========================================
Files 799 799
Lines 280245 280268 +23
Branches 54121 54125 +4
==========================================
+ Hits 254097 254102 +5
- Misses 16277 16286 +9
- Partials 9871 9880 +9
🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ran into this while running some benchmarks and seeing the memory grow
Removing an event listener that was added with a
signalleaves its abort listener hanging on the signal.As an example, here, each add/remove cycle leaks one listener, until the signal aborts (if ever)