-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
fix(reactivity): ensure watch cleanup on effect scope stop #12373
Conversation
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-ssr
@vue/compiler-sfc
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've posted a comment at #12370 (comment). I don't think it actually is a memory leak.
I'm not sure whether the use case presented on that issue is valid, but if I'm understanding correctly, the objective here is just to improve the teardown handling within EffectScope
, so that the effects aren't retained after the scope is stopped.
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
📝 Ran ecosystem CI: Open
|
6eb2d11
to
0073a01
Compare
@@ -119,17 +119,24 @@ export class EffectScope { | |||
if (this._active) { | |||
this._active = false | |||
let i, l | |||
for (i = 0, l = this.effects.length; i < l; i++) { | |||
this.effects[i].stop() | |||
const effects = this.effects.slice() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for what reason do you need to make this slice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close #12370