mirror of https://github.com/sveltejs/svelte
When a derived is disconnected (its last reader is hidden), then its dependency is changed and the reader is shown again, `reconnect` unconditionally pushed the derived into the dependency's `reactions` array. If it was already present, this left a duplicate entry that `remove_reaction` only removes once, leaking the derived (and any component it is owned by) after unmount. Guard the push with a membership check so a derived is only ever registered once per dependency.pull/18783/head
parent
5895c637b0
commit
87336a9dbb
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: avoid duplicate reaction when reconnecting a derived after its reader is hidden
|
||||
Loading…
Reference in new issue