fixed memory leak in btMultiSapBroadphase,

fixed hash function (typo, should use 2 proxies)
Thanks to Stephen (shatcher) for reporting and fixes!
http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1696
This commit is contained in:
ejcoumans
2007-11-17 17:07:58 +00:00
parent 56c69bc42e
commit 56e072ccc6
2 changed files with 2 additions and 2 deletions

View File

@@ -80,7 +80,7 @@ btBroadphaseProxy* btMultiSapBroadphase::createProxy( const btVector3& aabbMin,
simpleProxy->m_multiSapParentProxy = proxy;
mem = btAlignedAlloc(sizeof(btChildProxy),16);
btChildProxy* childProxyRef = new btChildProxy();
btChildProxy* childProxyRef = new(mem) btChildProxy();
childProxyRef->m_proxy = simpleProxy;
childProxyRef->m_childBroadphase = m_simpleBroadphase;
proxy->m_childProxies.push_back(childProxyRef);

View File

@@ -177,7 +177,7 @@ private:
SIMD_FORCE_INLINE unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2)
{
int key = ((unsigned int)proxyId1) | (((unsigned int)proxyId1) <<16);
int key = ((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16);
// Thomas Wang's hash
key += ~(key << 15);