fix(reactivity): fix dev-only memory leak by updating dep.subsHead on sub removal
ref #11956
This commit is contained in:
parent
f927a4ae6f
commit
5c8b76ed6c
|
@ -413,6 +413,10 @@ function removeSub(link: Link) {
|
||||||
// was previous tail, point new tail to prev
|
// was previous tail, point new tail to prev
|
||||||
dep.subs = prevSub
|
dep.subs = prevSub
|
||||||
}
|
}
|
||||||
|
if (__DEV__ && dep.subsHead === link) {
|
||||||
|
// was previous head, point new head to next
|
||||||
|
dep.subsHead = nextSub
|
||||||
|
}
|
||||||
|
|
||||||
if (!dep.subs && dep.computed) {
|
if (!dep.subs && dep.computed) {
|
||||||
// last subscriber removed
|
// last subscriber removed
|
||||||
|
|
Loading…
Reference in New Issue