Check first if we own the constraint before deleting it.

This commit is contained in:
czeidler 2012-02-10 11:39:35 +13:00 committed by Alex Wilson
parent 4878cc70e2
commit 15ef732f0d

View File

@ -200,7 +200,8 @@ bool
LinearSpec::RemoveConstraint(Constraint* constraint, bool deleteConstraint)
{
fSolver->ConstraintRemoved(constraint);
fConstraints.RemoveItem(constraint);
if (!fConstraints.RemoveItem(constraint))
return false;
constraint->fIsValid = false;
SummandList* leftSide = constraint->LeftSide();