Fix: dont use bumpslab anymore, just box scopestates

This commit is contained in:
Jonathan Kelley committed 2023-07-19 18:40:43 -07:00
1 parent 72a2a1f820
commit 4240f8428c
10 files changed
+48 -132

No files matched your search

+5 -5
View File
@@ -91,21 +91,21 @@ impl VirtualDom {
// Note: This will not remove any ids from the arena
pub(crate) fn drop_scope(&mut self, id: ScopeId, recursive: bool) {
self.dirty_scopes.remove(&DirtyScope {
height: self.scopes[id].height,
height: self.scopes[id.0].height,
id,
});
self.ensure_drop_safety(id);
if recursive {
if let Some(root) = self.scopes[id].try_root_node() {
if let Some(root) = self.scopes[id.0].try_root_node() {
if let RenderReturn::Ready(node) = unsafe { root.extend_lifetime_ref() } {
self.drop_scope_inner(node)
}
}
}
let scope = &mut self.scopes[id];
let scope = &mut self.scopes[id.0];
// Drop all the hooks once the children are dropped
// this means we'll drop hooks bottom-up
@@ -116,7 +116,7 @@ impl VirtualDom {
scope.tasks.remove(task_id);
}
self.scopes.remove(id);
self.scopes.remove(id.0);
}
fn drop_scope_inner(&mut self, node: &VNode) {
@@ -137,7 +137,7 @@ impl VirtualDom {
/// Descend through the tree, removing any borrowed props and listeners
pub(crate) fn ensure_drop_safety(&self, scope_id: ScopeId) {
let scope = &self.scopes[scope_id];
let scope = &self.scopes[scope_id.0];
// make sure we drop all borrowed props manually to guarantee that their drop implementation is called before we
// run the hooks (which hold an &mut Reference)