-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix: remove memory leak from bind:this #11194
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
Conversation
🦋 Changeset detectedLatest commit: 0b1a78a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Under what circumstance was this leaking memory? Always, because the effect is created in the cleanup phase of another effect? |
Yep. Plus it was an effect, so it built a relationship with the signals. |
It really feels like creating effects inside teardown should be forbidden, even if that makes the implementation of |
@Rich-Harris Agreed. Updated PR to add error for that use-case. |
I've fixed the issues and came up with using the task queue instead which resolves of the issues and avoids us having to change that test. |
This removes a nasty memory leak to do with
bind:this
. The PR also adds a runtime invariant for trying to create effects inside the teardown phase of an effect – as people shouldn't be creating new effects in something that's meant to be getting garbage collected.