czaloj / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Memory leak in btSoftBodyRigidBodyCollisionConfiguration constructor #115

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There is a memory leak in btSoftBodyRigidBodyCollisionConfiguration
constructor in case the m_collisionAlgorithmPool needs to be reallocated:
the destructor of the pool allocator is not called causing the pool memory
to be lost. The code should be as follow:

if (collisionAlgorithmMaxElementSize > curElemSize)
{
    m_collisionAlgorithmPool->~btPoolAllocator();
    btAlignedFree(m_collisionAlgorithmPool);
    void* mem = btAlignedAlloc(sizeof(btPoolAllocator),16);
    m_collisionAlgorithmPool = new(mem)
btPoolAllocator(collisionAlgorithmMaxElementSize,constructionInfo.m_defaultMaxCo
llisionAlgorithmPoolSize);
}

Original issue reported on code.google.com by benoitbo...@gmail.com on 18 Oct 2008 at 6:32

GoogleCodeExporter commented 9 years ago
I've fixed the bug in Blender bullet's repository already.

Original comment by benoitbo...@gmail.com on 18 Oct 2008 at 6:33

GoogleCodeExporter commented 9 years ago
Thanks for the report, it has been fixed in latest trunk.
http://code.google.com/p/bullet/source/detail?r=1418

Original comment by erwin.coumans on 27 Oct 2008 at 8:24