Skip to content

Commit

Permalink
move the mutex lock to include the 'getNewManifold', dealing with Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
erwincoumans committed Jan 3, 2022
1 parent 0ab3b9d commit 5d1c8a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 5d1c8a2

Please sign in to comment.