fixed crash on layout event from deleted node
@@ -745,14 +745,14 @@ impl UserInterface {
nodes: &Pool<UiNode>,
node: Handle<UiNode>,
) {
- let node_ref = &nodes[node];
-
+ if let Some(node_ref) = nodes.try_borrow(node) {
node_ref.measure_valid.set(false);
if node_ref.parent().is_some() {
invalidate_measurement_recursive_up(nodes, node_ref.parent());
}
}
+ }
invalidate_measurement_recursive_up(&self.nodes, node);
}
@@ -761,14 +761,14 @@ impl UserInterface {
nodes: &Pool<UiNode>,
node: Handle<UiNode>,
) {
- let node_ref = &nodes[node];
-
+ if let Some(node_ref) = nodes.try_borrow(node) {
node_ref.arrange_valid.set(false);
if node_ref.parent().is_some() {
invalidate_arrangement_recursive_up(nodes, node_ref.parent());
}
}
+ }
invalidate_arrangement_recursive_up(&self.nodes, node);
}
