summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerwincoumans <erwincoumans@google.com>2021-04-22 16:29:01 -0700
committerGitHub <noreply@github.com>2021-04-22 16:29:01 -0700
commitafb572166adaf70867101739b3a0203a9bbd3087 (patch)
tree0ce0050c24ffb17a0339d2f8f7d8c120ed4c49a5
parent00dcc77885bc6ecd7386e5f805c07d6c85e578a1 (diff)
parent225fa2094472f05d2ba846d58334f24d37910765 (diff)
downloadbullet3-afb572166adaf70867101739b3a0203a9bbd3087.tar.gz
Merge pull request #3353 from crewmatt/master
Fix memory leak in BulletSoftBody.
-rw-r--r--src/BulletSoftBody/btDeformableBodySolver.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/BulletSoftBody/btDeformableBodySolver.cpp b/src/BulletSoftBody/btDeformableBodySolver.cpp
index 4b11fccec..e81680f01 100644
--- a/src/BulletSoftBody/btDeformableBodySolver.cpp
+++ b/src/BulletSoftBody/btDeformableBodySolver.cpp
@@ -405,6 +405,10 @@ void btDeformableBodySolver::predictMotion(btScalar solverdt)
for (int i = 0; i < m_softBodies.size(); ++i)
{
btSoftBody* psb = m_softBodies[i];
+ /* Clear contacts */
+ psb->m_nodeRigidContacts.resize(0);
+ psb->m_faceRigidContacts.resize(0);
+ psb->m_faceNodeContacts.resize(0);
if (psb->isActive())
{
@@ -472,10 +476,6 @@ void btDeformableBodySolver::predictDeformableMotion(btSoftBody* psb, btScalar d
{
psb->updateFaceTree(true, true);
}
- /* Clear contacts */
- psb->m_nodeRigidContacts.resize(0);
- psb->m_faceRigidContacts.resize(0);
- psb->m_faceNodeContacts.resize(0);
/* Optimize dbvt's */
// psb->m_ndbvt.optimizeIncremental(1);
// psb->m_fdbvt.optimizeIncremental(1);