Skip to content

Conversation

@liuhanqu
Copy link
Contributor

@liuhanqu liuhanqu commented Dec 4, 2024

Fixes #75

index.js Outdated
Comment on lines 38 to 40
if (signal) {
signal.removeEventListener('abort', signalListener);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (signal) {
signal.removeEventListener('abort', signalListener);
}
signal?.removeEventListener('abort', signalListener);

@sindresorhus sindresorhus changed the title Cleanup listener Fix cleaning up abort listener Dec 5, 2024
@sindresorhus sindresorhus merged commit 65e893e into sindresorhus:main Dec 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak when using abort signals

2 participants