diff --git a/packages/core/src/scopes.rs b/packages/core/src/scopes.rs index c6c0cb846..b90ff6f6e 100644 --- a/packages/core/src/scopes.rs +++ b/packages/core/src/scopes.rs @@ -213,9 +213,7 @@ impl ScopeArena { } pub fn collect_garbage(&self, id: ElementId) { - let node = self.nodes.borrow_mut().get(id.0).unwrap().clone(); - // let node = self.nodes.borrow_mut().remove(id.0); - // log::debug!("collecting garbage for {:?}, {:?}", id, unsafe { &*node }); + self.nodes.borrow_mut().remove(id.0); } /// This method cleans up any references to data held within our hook list. This prevents mutable aliasing from @@ -231,8 +229,6 @@ impl ScopeArena { /// This also makes sure that drop order is consistent and predictable. All resources that rely on being dropped will /// be dropped. pub(crate) fn ensure_drop_safety(&self, scope_id: ScopeId) { - // log::trace!("Ensuring drop safety for scope {:?}", scope_id); - if let Some(scope) = self.get_scope(scope_id) { let mut items = scope.items.borrow_mut(); @@ -243,7 +239,6 @@ impl ScopeArena { if let Some(scope_id) = comp.scope.get() { self.ensure_drop_safety(scope_id); } - drop(comp.props.take()); }); diff --git a/packages/core/src/virtual_dom.rs b/packages/core/src/virtual_dom.rs index b273e6239..670613dd4 100644 --- a/packages/core/src/virtual_dom.rs +++ b/packages/core/src/virtual_dom.rs @@ -449,6 +449,7 @@ impl VirtualDom { /// apply_mutations(mutations); /// } /// ``` + #[allow(unused)] pub fn work_with_deadline(&mut self, mut deadline: impl FnMut() -> bool) -> Vec { let mut committed_mutations = vec![]; @@ -487,13 +488,12 @@ impl VirtualDom { committed_mutations.push(mutations); + // todo: pause the diff machine // if diff_state.work(&mut deadline) { // let DiffState { mutations, .. } = diff_state; - // for scope in &mutations.dirty_scopes { // self.dirty_scopes.remove(scope); // } - // committed_mutations.push(mutations); // } else { // // leave the work in an incomplete state