Skip to content

Commit

Permalink
[SofaConstraint] FIX segfault in GenericConstraintSolver (#2265)
Browse files Browse the repository at this point in the history
* [SofaConstraint] fix segfault in GenericConstraintSolver (bug introduced in PR#2225)

* [SofaConstraint] range based for loop

Co-authored-by: EulalieCoevoet <>
Co-authored-by: alxbilger <alxbilger@users.noreply.github.com>
  • Loading branch information
2 people authored and guparan committed Sep 23, 2021
1 parent 387326d commit c5c2b7c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,13 @@ void GenericConstraintProblem::clear(int nbC)

void GenericConstraintProblem::freeConstraintResolutions()
{
for(auto* constraintsResolution : constraintsResolutions)
for(auto*& constraintsResolution : constraintsResolutions)
{
delete constraintsResolution;
constraintsResolution = nullptr;
}
}

int GenericConstraintProblem::getNumConstraints()
{
return dimension;
Expand Down

0 comments on commit c5c2b7c

Please sign in to comment.