ソースを参照

fix(reactivity): properly cleanup effectScope

daiwei 10 ヶ月 前
コミット
ea6c064838
1 ファイル変更2 行追加2 行削除
  1. 2 2
      packages/reactivity/src/effect.ts

+ 2 - 2
packages/reactivity/src/effect.ts

@@ -271,12 +271,12 @@ export function resetTracking(): void {
 export function cleanup(
   sub: ReactiveNode & { cleanups: (() => void)[]; cleanupsLength: number },
 ): void {
-  const l = sub.cleanupsLength
+  const l = sub.cleanups.length
   if (l) {
     for (let i = 0; i < l; i++) {
       sub.cleanups[i]()
     }
-    sub.cleanupsLength = 0
+    sub.cleanups.length = sub.cleanupsLength = 0
   }
 }