X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_Solver.cpp;h=4e7a4f0e9269f7e2d76ad8219a130fce099864f3;hb=20d233731eaae06b9a75280a2ca675bc9a11cc72;hp=0e7b1761cc51e62b2aeeede9ce12c1c952d9f51c;hpb=33b3a43ad2266cb044e4232c902344842adbba7c;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_Solver.cpp b/src/SketchSolver/SketchSolver_Solver.cpp index 0e7b1761c..4e7a4f0e9 100644 --- a/src/SketchSolver/SketchSolver_Solver.cpp +++ b/src/SketchSolver/SketchSolver_Solver.cpp @@ -63,8 +63,10 @@ void SketchSolver_Solver::setConstraints(Slvs_Constraint* theConstraints, int th myEquationsSystem.constraints = theSize; } else if (myEquationsSystem.constraints != theSize) { - delete[] myEquationsSystem.constraint; - myEquationsSystem.constraint = new Slvs_Constraint[theSize]; + if (theSize > myEquationsSystem.constraints) { + delete[] myEquationsSystem.constraint; + myEquationsSystem.constraint = new Slvs_Constraint[theSize]; + } myEquationsSystem.constraints = theSize; } memcpy(myEquationsSystem.constraint, theConstraints, theSize * sizeof(Slvs_Constraint));