diff options
Diffstat (limited to 'sccomp/source/solver/LpsolveSolver.cxx')
-rw-r--r-- | sccomp/source/solver/LpsolveSolver.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sccomp/source/solver/LpsolveSolver.cxx b/sccomp/source/solver/LpsolveSolver.cxx index 6a6c55d961ad..08b56ff1f9e9 100644 --- a/sccomp/source/solver/LpsolveSolver.cxx +++ b/sccomp/source/solver/LpsolveSolver.cxx @@ -186,12 +186,12 @@ void SAL_CALL LpsolveSolver::solve() // set objective function const std::vector<double>& rObjCoeff = aCellsHash[maObjective]; - REAL* pObjVal = new REAL[nVariables+1]; + std::unique_ptr<REAL[]> pObjVal(new REAL[nVariables+1]); pObjVal[0] = 0.0; // ignored for (nVar=0; nVar<nVariables; nVar++) pObjVal[nVar+1] = rObjCoeff[nVar+1]; - set_obj_fn( lp, pObjVal ); - delete[] pObjVal; + set_obj_fn( lp, pObjVal.get() ); + pObjVal.reset(); set_rh( lp, 0, rObjCoeff[0] ); // constant term of objective // add rows |