diff --git a/tests/tests/ChipmunkTest/Sensors.cpp b/tests/tests/ChipmunkTest/Sensors.cpp index 053dc33ae5..e515fc6dc2 100644 --- a/tests/tests/ChipmunkTest/Sensors.cpp +++ b/tests/tests/ChipmunkTest/Sensors.cpp @@ -65,11 +65,11 @@ blockerSeparate(cpArbiter *arb, cpSpace *space, void *unused) static void postStepRemove(cpSpace *space, cpShape *shape, void *unused) -{ +{ + cpSpaceRemoveShape(space, shape); cpSpaceRemoveBody(space, shape->body); cpBodyFree(shape->body); - - cpSpaceRemoveShape(space, shape); + cpShapeFree(shape); }