Find why these nodes can remain allocated after external handles are dropped.
Rust
use std::cell::RefCell;
use std::rc::Rc;
struct Node {
parent: RefCell<Option<Rc<Node>>>,
children: RefCell<Vec<Rc<Node>>>,
}
fn attach(parent: &Rc<Node>, child: &Rc<Node>) {
*child.parent.borrow_mut() = Some(Rc::clone(parent));
parent.children.borrow_mut().push(Rc::clone(child));
}