Skip to content

Commit a0b78f6

Browse files
committed
effectScope scopes doubly-linked list
1 parent 00ddb5b commit a0b78f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/reactivity/src/effectScope.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ export class EffectScope {
147147

148148
// nested scope, dereference from parent to avoid memory leaks
149149
if (!this.detached && this.parent && !fromParent) {
150+
if(this.prevEffectScope) {
151+
this.prevEffectScope.nextEffectScope = this.nextEffectScope;
152+
}
153+
if(this.nextEffectScope) {
154+
this.nextEffectScope.prevEffectScope = this.prevEffectScope;
155+
}
150156
if(this.parent.scopes == this) {
151157
this.parent.scopes = this.nextEffectScope;
152158
}

0 commit comments

Comments
 (0)