fix: scopes not dropping their hooks

This commit is contained in:
Jonathan Kelley committed 2023-01-15 10:02:24 -08:00
1 parent 1737c55575
commit 69a347a551
3 files changed
+48 -11

No files matched your search

+7 -2
View File
@@ -1,8 +1,8 @@
use std::ptr::NonNull;
use crate::{
nodes::RenderReturn, nodes::VNode, virtual_dom::VirtualDom, AttributeValue, DynamicNode,
ScopeId,
innerlude::DirtyScope, nodes::RenderReturn, nodes::VNode, virtual_dom::VirtualDom,
AttributeValue, DynamicNode, ScopeId,
};
use bumpalo::boxed::Box as BumpBox;
@@ -89,6 +89,11 @@ impl VirtualDom {
// Drop a scope and all its children
pub(crate) fn drop_scope(&mut self, id: ScopeId) {
self.dirty_scopes.remove(&DirtyScope {
height: self.scopes[id.0].height,
id,
});
self.ensure_drop_safety(id);
if let Some(root) = self.scopes[id.0].as_ref().try_root_node() {