What's the right way to delete a Chipmunk body? Simply calling cpBodyFree
or cpBodyDestroy
doesn't seem to work, as the body still shows up in the cpSpaceEachBody
iteration.
if(body->p.y < -260 || fabsf(body->p.x) > 340) {
/* body is permanently off the screen */
/* so it needs to be permanently deleted */
cpBodyFree(body); ??
cpBodyDestroy(body); ??
}