fix: don't panic when Model is dropped before parts are generated
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -646,7 +646,7 @@ impl ModelAspect for Model {
|
||||
}
|
||||
impl Drop for Model {
|
||||
fn drop(&mut self) {
|
||||
for p in self.parts.get().unwrap().iter() {
|
||||
for p in self.parts.get().iter().flat_map(|v|v.iter()) {
|
||||
if let Some(node) = p.spatial.node() {
|
||||
node.destroy();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user