fix: prevent double borrow

This commit is contained in:
Jonathan Kelley committed 2022-12-22 11:32:42 -05:00
1 parent 56d193d196
commit 870d857a93
1 file changed
+3 -1
+3 -1
View File
@@ -149,7 +149,9 @@ impl VirtualDom {
Some(child) if child != scope_id => self.ensure_drop_safety(child), Some(child) if child != scope_id => self.ensure_drop_safety(child),
_ => (), _ => (),
} }
drop(comp.props.take()); if let Ok(mut props) = comp.props.try_borrow_mut() {
*props = None;
}
}); });
// Now that all the references are gone, we can safely drop our own references in our listeners. // Now that all the references are gone, we can safely drop our own references in our listeners.