[ODE] Fix leaking of s_cachedPosR in collision_kernel.cpp
gcarlton at iinet.net.au
Sun Jun 18 23:09:20 MST 2006
It is already in dCloseODE, which to my mind is the most important
place. The leak checking I have is explicitly called just before the
end of main(), and I ensure everything I use is able to clear itself up
In the case of a user who doesn't wish to call dCloseODE but does wish
to check for leaks (and who doesn't need them cleared at runtime rather
than at unordered static exit time), then I guess this extra code would
However, given there may be other statics floating around either now or
in the future, it may be better to have the Dispose class call dCloseODE
rather than free the posr cache directly. This would ensure that if
anything else was added to dCloseODE it too will be cleaned up
automatically (although somewhat redundantly) at exit.
Jon Watte (ODE) wrote:
> "better" in the sense that if you don't call dCloseODE(), it doesn't
> happen? I don't know; I chose this solution. Feel free to fix it some
> other way if you prefer.
> / h+
> Jason Perkins wrote:
>> On 6/18/06, Jon Watte (ODE) <hplus-ode at mindcontrol.org> wrote:
>>> When using leak checking allocators, the cached posR
>>> inside collision_kernel.cpp gets reported. This patch
>>> makes sure it gets disposed before the Windows leak
>>> checker finds it, enabling a clean test run (at least
>>> in my test code).
>> This does the trick, but would it be better to do it in dCloseODE()?
> ODE mailing list
> ODE at q12.org
More information about the ODE