fix: destroy prebound parts on model drop

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-10-31 23:41:28 +01:00
parent 771a79cd33
commit e00b487167

View File

@@ -651,6 +651,11 @@ impl Drop for Model {
node.destroy();
}
}
for p in self.pre_bound_parts.lock().iter() {
if let Some(node) = p.spatial.node() {
node.destroy();
}
}
MODEL_REGISTRY.remove(self);
}
}