Skip to content

fix: clean up instance remove lifecycle hooks - #9085

Open
slash-init wants to merge 2 commits into
processing:mainfrom
slash-init:fix/lifecycle-hooks-remove-cleanup
Open

fix: clean up instance remove lifecycle hooks#9085
slash-init wants to merge 2 commits into
processing:mainfrom
slash-init:fix/lifecycle-hooks-remove-cleanup

Conversation

@slash-init

Copy link
Copy Markdown

Resolves #9072

Changes:

Replaced the instance-specific lifecycle hook named remove that was used for clearing the focus and blur event listeners with the signal from the existing AbortController.
This stops the function p5.lifecycleHooks.remove from accumulating hooks when p5 instances are removed. I've also added a regression test to ensure that the hooks are cleaned up after the instances have been removed.

Screenshots of the change:

Not applicable.

PR Checklist

@slash-init slash-init changed the title Fix/lifecycle hooks remove cleanup fix: clean up instance remove lifecycle hooks Aug 16, 2026
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.

[p5.js 2.0+ Bug Report]: remove() accumulates lifecycle hooks across instances

1 participant