drop any attribute after rendering

This commit is contained in:
Evan Almloff committed 2023-10-25 16:37:04 -05:00
1 parent b25fada776
commit b99f081c08
4 files changed
+37 -12

No files matched your search

+1 -4
View File
@@ -164,16 +164,13 @@ impl VirtualDom {
});
// Now that all the references are gone, we can safely drop our own references in our listeners.
let mut listeners = scope.attributes_to_drop.borrow_mut();
let mut listeners = scope.attributes_to_drop_before_render.borrow_mut();
listeners.drain(..).for_each(|listener| {
let listener = unsafe { &*listener };
match &listener.value {
AttributeValue::Listener(l) => {
_ = l.take();
}
AttributeValue::Any(a) => {
_ = a.take();
}
_ => (),
}
});