Don't expect all components to have a scope in ScopeArena.ensure_drop_safety
Not all components will be mounted when using a Router, so we cannot assume all components have a scope.
This commit is contained in:
1 parent
81c094ed29
commit
9b282d877b
1 file changed
+3
-6
@@ -198,12 +198,9 @@ impl ScopeArena {
|
|||||||
// run the hooks (which hold an &mut Reference)
|
// run the hooks (which hold an &mut Reference)
|
||||||
// recursively call ensure_drop_safety on all children
|
// recursively call ensure_drop_safety on all children
|
||||||
items.borrowed_props.drain(..).for_each(|comp| {
|
items.borrowed_props.drain(..).for_each(|comp| {
|
||||||
let scope_id = comp
|
if let Some(scope_id) = comp.scope.get() {
|
||||||
.scope
|
self.ensure_drop_safety(scope_id);
|
||||||
.get()
|
}
|
||||||
.expect("VComponents should be associated with a valid Scope");
|
|
||||||
|
|
||||||
self.ensure_drop_safety(scope_id);
|
|
||||||
|
|
||||||
drop(comp.props.take());
|
drop(comp.props.take());
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user