Skip to content

Commit fbbb65a

Browse files
authored
Fix owner leak in destroy_shape() (#344)
Ensures that lingering owner references are cleared after a shape is destroyed by adding a call to `clear()` on the `owners` HashMap. Fixes #266.
1 parent 877a551 commit fbbb65a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/shapes/rapier_shape_base.rs

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ impl RapierShapeBase {
120120

121121
pub fn destroy_shape(&mut self, physics_engine: &mut PhysicsEngine) {
122122
physics_engine.shape_destroy(self.get_id());
123+
self.state.owners.clear();
123124
}
124125

125126
#[cfg(feature = "serde-serialize")]

0 commit comments

Comments
 (0)