-
-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure everything is disposed of consistently #2639
Conversation
The property and its node are removed entirely, so it's more aligned with `dispose_node` than `cleanup_node`.
Besides this patch, an interesting option might be to wrap things like the |
After auditing the Edit: also |
It would be very helpful to have a reproducible example of the issue(s) this is addressing, either here or in a linked issue. |
Of course, I added a couple of regression tests which currently fail on Something not covered is the fact that subscribers are now also cleaned if the node is disposed of directly (previously only if they were a child of a cleaned up node). Separately, I think |
Thanks very much! The tests are great and will be helpful to make sure this correct behavior carries over into the next version, too. |
Hi there!
This one popped up for us as a
BorrowMut
error on theon_cleanups
secondary map, here's what I think was going on:dispose_node
was removing nodeA from the reactive graph, but not running the cleanups.slotmap
was reused by nodeB, and nodeB usedon_cleanup
.Drop
impls that triggered some work, which were triggered insideslotmap
.on_cleanup
, we recurse and panic.With this patch I tried to simplify and make it more obvious what cleaning up a node and disposing of it means, hopefully my understanding of what's going on here is correct.
The commits are meant to be easy to audit individually, and
refactor
commits are meant to match the original behaviour exactly.And as always, thank you for
leptos
, it has been great!