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

We should forward the subscribers abort signal to eventListeners #187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maraisr
Copy link
Contributor

@maraisr maraisr commented Dec 11, 2024

I think there is a possible event listener leak that can occur if we don't have a mechanism to clean up event listeners as subscriptions are aborted.

In WebKit I confirmed, that if we were to follow the spec we'd keep listeners around for a little too long:

CleanShot 2024-12-11 at 09 32 01

Much like Chrome's EventTarget implementation, WebKits' also immediately take ownership of the EventListener, so that despite the Observable is marked for GC (active == 0), the listener hangs around.

and I think Chrome had a similar discovery, as they also forward the signal to the event listener to trigger the abort steps.


Preview | Diff

@maraisr
Copy link
Contributor Author

maraisr commented Dec 11, 2024

cc @domfarolino

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.

1 participant