Merge pull request #4119 from erwincoumans/master

move the mutex lock to include the 'getNewManifold', dealing with Iss…
This commit is contained in:
erwincoumans 2022-01-03 16:13:27 -08:00 committed by GitHub
commit dc72081eb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -902,8 +902,8 @@ void btDiscreteDynamicsWorld::createPredictiveContactsInternal(btRigidBody** bod
btVector3 distVec = (predictedTrans.getOrigin() - body->getWorldTransform().getOrigin()) * sweepResults.m_closestHitFraction;
btScalar distance = distVec.dot(-sweepResults.m_hitNormalWorld);
btPersistentManifold* manifold = m_dispatcher1->getNewManifold(body, sweepResults.m_hitCollisionObject);
btMutexLock(&m_predictiveManifoldsMutex);
btPersistentManifold* manifold = m_dispatcher1->getNewManifold(body, sweepResults.m_hitCollisionObject);
m_predictiveManifolds.push_back(manifold);
btMutexUnlock(&m_predictiveManifoldsMutex);