[ODE] being so picky about memory...
Nate W
coding at natew.com
Sat Dec 22 19:38:01 2001
...you'd think it would take me less than three tries to get this right!
This, unlike the previous two renditions, does not crash on exit if you
didn't create any geometry. Sorry!
void dCloseODE ()
{
if (classes)
{
for (int i = 0; i < classes->size (); i++)
{
dFree ((*classes)[i], sizeof (dxGeomClass));
}
dFree (classes->_data, sizeof (dxGeomClass*) * classes->_anum);
dFree (classes, sizeof(dArrayBase));
}
if (colliders)
{
dFree (colliders->_data, sizeof (dColliderEntry) * classes->_anum);
dFree (colliders, sizeof(dArrayBase));
}
}