views:

63

answers:

1

Helo,

I am using chipmunk as a physics engine in my game. The problem is I now want to free all the children and then the space itself, so I can create a new space for the new level. I tried this:

cpSpaceFreeChildren(space);

cpSpaceFree(space);

But it does not work and fails in:

 cpHashSetReject(cpHashSet *set, cpHashSetRejectFunc func, void *data)
{

// Iterate over all the chains. for(int i=0; isize; i++){ <-- here

Is there anything I need to clean up before calling this two methods?. Any help will be greatly apreciated. Thank you.

-Oscar

A: 

I forgot to unschedule my tick: function that calls cpstep before freeing the space... It is working now.

OscarMk