fix memory leak when calling initializePolyhedralFeatures
Fixes Issue 623, thanks for the report/patch!
This commit is contained in:
@@ -31,6 +31,7 @@ btPolyhedralConvexShape::~btPolyhedralConvexShape()
|
|||||||
{
|
{
|
||||||
if (m_polyhedron)
|
if (m_polyhedron)
|
||||||
{
|
{
|
||||||
|
m_polyhedron->~btConvexPolyhedron();
|
||||||
btAlignedFree(m_polyhedron);
|
btAlignedFree(m_polyhedron);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,7 +41,10 @@ bool btPolyhedralConvexShape::initializePolyhedralFeatures()
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (m_polyhedron)
|
if (m_polyhedron)
|
||||||
|
{
|
||||||
|
m_polyhedron->~btConvexPolyhedron();
|
||||||
btAlignedFree(m_polyhedron);
|
btAlignedFree(m_polyhedron);
|
||||||
|
}
|
||||||
|
|
||||||
void* mem = btAlignedAlloc(sizeof(btConvexPolyhedron),16);
|
void* mem = btAlignedAlloc(sizeof(btConvexPolyhedron),16);
|
||||||
m_polyhedron = new (mem) btConvexPolyhedron;
|
m_polyhedron = new (mem) btConvexPolyhedron;
|
||||||
|
|||||||
Reference in New Issue
Block a user