Possible leak in btConvexConvexAlgorithm::CreateFunc

AshMcConnell
Posts: 29
Joined: Sat Sep 23, 2006 1:35 pm
Location: Northern Ireland

Possible leak in btConvexConvexAlgorithm::CreateFunc

Post by AshMcConnell »

Hi Folks,

I'm not sure if i'm not shutting something down properly, but I am getting a small amount of memory unallocated after a run.

The constructor: -

Code: Select all

btConvexConvexAlgorithm::CreateFunc::CreateFunc()
{
	m_ownsSolvers = true;
	m_simplexSolver = new btVoronoiSimplexSolver();
	m_pdSolver = new btGjkEpaPenetrationDepthSolver;
}

There is no destructor, so I created one: -

Code: Select all

btConvexConvexAlgorithm::CreateFunc::~CreateFunc()
{
	if (m_ownsSolvers){
		delete m_simplexSolver;
		delete m_pdSolver;
	}
}
I have no leaks now, I hope this helps.

All the best,
Ash
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Thanks for reporting!

I missed your fix for Bullet 2.44, but it is in Subversion so it goes into next version (2.45).

Erwin
AshMcConnell
Posts: 29
Joined: Sat Sep 23, 2006 1:35 pm
Location: Northern Ireland

Post by AshMcConnell »

Good stuff, glad it was helpful.

All the best,
Ash