Chipmunk cp.spaceFree error processing arguments

Chipmunk cp.spaceFree error processing arguments
0.0 0


Could anyone tell me why I am getting ‘error processing arguments’ error during execute of spaceFree method?
I use Cocos2dx JSB 2.2.3

My code:

space = new cp.Space();
space.gravity = cp.v(0, -800);
space.iterations = 30;
space.sleepTimeThreshold = Infinity;
space.collisionSlop = Infinity;


Kind regards


I really need the answer ASAP. Can I use these functions in JSB? If not - how to remove physics object?


Why are you freeing the space there, or is this just a snippet?

Perhaps it gets garbage collected?

Try using = new cp.Space();
// ...


hello , i meet the same problem.could you tell me how to solve the problem?thank you very much!