refactor(node): defer setting client until adding to scenegraph

This commit is contained in:
Nova
2022-06-14 18:18:22 -04:00
parent beaa3d0e6b
commit 651fa5f012
4 changed files with 11 additions and 30 deletions

View File

@@ -27,6 +27,8 @@ impl Scenegraph {
}
pub fn add_node(&self, node: Node) -> RcCell<Node> {
let mut node = node;
node.client = Rc::downgrade(&self.get_client());
let path = node.get_path().to_string();
let node_rc = RcCell::new(node);
self.nodes.insert(path, node_rc.clone());