void freeDll(void) { int i; Variable *var; //Poistettaan kaikki muuttujat for (i = 1; i != mVariableHandler.mSize;i++) { var = mVariableHandler.mPtrArray[i]; if (var != NULL) { switch(var->mType) { case VarTypeBody: cpBodyFree((cpBody*)var->mPtr);break; case VarTypeShape: cpShapeFree((cpShape*)var->mPtr);break; case VarTypeConstraint: cpConstraintFree((cpConstraint*)var->mPtr);break; case VarTypeDataArray: daFree((DataArray*)var->mPtr);break; } } } //Tuhotaan ne kaikki... vhDestroy(&mVariableHandler); cpSpaceDestroy(&mSpace); mState = Unloaded; }
void cpSpaceFree(cpSpace *space) { if(space){ cpSpaceDestroy(space); cpfree(space); } }
void cpSpaceFree(cpSpace *space) { if(space) cpSpaceDestroy(space); free(space); }
World::~World() { cpSpaceDestroy(space); }