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