fix(runtime-core): component mount anchor memory leak (#2459)
fix #2458
This commit is contained in:
parent
82bf7ebf36
commit
3867bb4c14
@ -1395,8 +1395,9 @@ function baseCreateRenderer(
|
|||||||
}
|
}
|
||||||
// onVnodeMounted
|
// onVnodeMounted
|
||||||
if ((vnodeHook = props && props.onVnodeMounted)) {
|
if ((vnodeHook = props && props.onVnodeMounted)) {
|
||||||
|
const scopedInitialVNode = initialVNode
|
||||||
queuePostRenderEffect(() => {
|
queuePostRenderEffect(() => {
|
||||||
invokeVNodeHook(vnodeHook!, parent, initialVNode)
|
invokeVNodeHook(vnodeHook!, parent, scopedInitialVNode)
|
||||||
}, parentSuspense)
|
}, parentSuspense)
|
||||||
}
|
}
|
||||||
// activated hook for keep-alive roots.
|
// activated hook for keep-alive roots.
|
||||||
@ -1410,6 +1411,9 @@ function baseCreateRenderer(
|
|||||||
queuePostRenderEffect(a, parentSuspense)
|
queuePostRenderEffect(a, parentSuspense)
|
||||||
}
|
}
|
||||||
instance.isMounted = true
|
instance.isMounted = true
|
||||||
|
|
||||||
|
// #2458: deference mount-only object parameters to prevent memleaks
|
||||||
|
initialVNode = container = anchor = null as any
|
||||||
} else {
|
} else {
|
||||||
// updateComponent
|
// updateComponent
|
||||||
// This is triggered by mutation of component's own state (next: null)
|
// This is triggered by mutation of component's own state (next: null)
|
||||||
|
Loading…
Reference in New Issue
Block a user