Explorar el Código

fix(reactivity): properly cleanup effectScope

daiwei hace 10 meses
padre
commit
ea6c064838
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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
   }
 }