Browse Source

fix: prevent double borrow

Jonathan Kelley 2 years ago
parent
commit
870d857a93
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/core/src/arena.rs

+ 3 - 1
packages/core/src/arena.rs

@@ -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.