Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure listeners are registered only once #16

Merged
merged 1 commit into from
Feb 27, 2021

Conversation

Julusian
Copy link
Contributor

@Julusian Julusian commented Feb 27, 2021

It is possible for the application to re-register the exit-hook listeners many times. This is particularly apparent in unit tests, as they are likely to teardown all the hooks and recreate many times in a row and can cause node to complain about 'Maxeventlisteners exceeded'

Without this fix, the unit test will report that after creating unsubscribe3 there will be 2 listeners for exit.

@sindresorhus sindresorhus changed the title fix: ensure listeners are registered only once Ensure listeners are registered only once Feb 27, 2021
@sindresorhus sindresorhus merged commit 27afecb into sindresorhus:main Feb 27, 2021
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.

None yet

2 participants