[ODE] Memory allocation

Arturo Colorado Garín acolorado at telefonica.net
Sat Oct 2 21:12:21 MST 2004


To free a body, call dBodyDestroy(). To free a sphere or any other geom,
call dGeomDestroy().

In general, when you're going to free an object look up the documentation to
see if there is a matching free function for that object subtype. If there
is not, use a more generic free function (for example, dGeomDestroy() for
any geom or dJointDestroy() for any joint).

--Arturo


----- Original Message ----- 
From: Dominic Jackson
To: ode at q12.org
Cc: Adam Croston
Sent: Saturday, October 02, 2004 8:20 PM
Subject: [ODE] Memory allocation



Hi,

I am using dBodyCreate as well as other allocation functions such as
dCreateSphere etc...  from the collision modules.

Some of these functions don't seem to have matching free functions - can
anyone tell me what the correct way is to delete things

I suspect I will have to write my own functions unless I have just missed
something
( presumably if I just use delete on a dxGeom, It wont know how much memory
to delete for specific cases such as Box, Sphere, CCylinder etc .. )

Can anyone help on this or am I going down the right track just writing my
own wrapper functions.

I did notice in the code there is a pragma for no-matching delete warnings -
so perhaps this is intentional and I have missed the point ?

Regards

Dominic Jackson



More information about the ODE mailing list