Fixed memory leak in btDbvtBroadphase

http://code.google.com/p/bullet/issues/detail?id=66
This commit is contained in:
erwin.coumans
2008-07-22 15:07:04 +00:00
parent 3483e2dfc8
commit a9a67d62c3
2 changed files with 6 additions and 1 deletions

View File

@@ -159,7 +159,11 @@ clear(m_profiling);
//
btDbvtBroadphase::~btDbvtBroadphase()
{
if(m_releasepaircache) btAlignedFree(m_paircache);
if(m_releasepaircache)
{
m_paircache->~btOverlappingPairCache();
btAlignedFree(m_paircache);
}
}
//

View File

@@ -61,6 +61,7 @@ const int BT_NULL_PAIR=0xffffffff;
class btOverlappingPairCache : public btOverlappingPairCallback
{
public:
virtual ~btOverlappingPairCache() {} // this is needed so we can get to the derived class destructor
virtual btBroadphasePair* getOverlappingPairArrayPtr() = 0;