We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87d1e5f commit 01fdb51Copy full SHA for 01fdb51
packages/compiler-core/src/transforms/cacheStatic.ts
@@ -219,6 +219,12 @@ function walk(
219
// #6978, #7138, #7114
220
// a cached children array inside v-for can caused HMR errors since
221
// it might be mutated when mounting the first item
222
+ // #13221
223
+ // fix memory leak in cached array:
224
+ // cached vnodes get replaced by cloned ones during mountChildren,
225
+ // which bind DOM elements. These DOM references persist after unmount,
226
+ // preventing garbage collection. Array spread avoids mutating cached
227
+ // array, preventing memory leaks.
228
exp.needArraySpread = true
229
return exp
230
}
0 commit comments