[ODE] memory leak from redundant allocation in dBodyCreate

Christoph Beyer boernerb at web.de
Mon Dec 4 10:53:19 MST 2006


Riley Lark wrote:
> dBodyCreate calls dBodySetAutoDisableDefaults on line 254, which in
> turn calls dBodySetAutoDisableFlag on line 984, which then calls
> dBodySetAutoDisableAverageSamplesCount on line 969 as long as
> !do_auto_disable is true.  This leads to line 909 and 910.
>
>
You are right, sorry i never looked at the dBodySetAutoDisableFlag() 
function.
I changed line 261 and 262 to this:

    if(!b->average_lvel_buffer)
        b->average_lvel_buffer = new dVector3[b->adis.average_samples];
    if(!b->average_avel_buffer)
        b->average_avel_buffer = new dVector3[b->adis.average_samples];

so the buffer will not be recreated.
would you agree?
if yes, i will submit a patch on sourceforge.
i have unfortunately no access (and less knowledge) to svn...

cheers
christoph




More information about the ODE mailing list