]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(reactivity): properly cleanup effectScope edison/fix/effectStop 13606/head
authordaiwei <daiwei521@126.com>
Thu, 10 Jul 2025 06:26:03 +0000 (14:26 +0800)
committerdaiwei <daiwei521@126.com>
Thu, 10 Jul 2025 06:33:03 +0000 (14:33 +0800)
packages/reactivity/src/effect.ts

index af8ebea89a128e6d135b273fd17af0b72aba3ccd..65cd1c934e23e358c890210e5190b0f8a6e196d0 100644 (file)
@@ -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
   }
 }