diff options
Diffstat (limited to 'build/cpp/sci_minconTMINLP.cpp')
-rw-r--r-- | build/cpp/sci_minconTMINLP.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/build/cpp/sci_minconTMINLP.cpp b/build/cpp/sci_minconTMINLP.cpp index 7885083..350594d 100644 --- a/build/cpp/sci_minconTMINLP.cpp +++ b/build/cpp/sci_minconTMINLP.cpp @@ -31,7 +31,7 @@ using namespace Bonmin; minconTMINLP::~minconTMINLP() { - free(finalX_); + if(finalX_) delete[] finalX_; } // Set the type of every variable - CONTINUOUS or INTEGER @@ -300,7 +300,7 @@ void minconTMINLP::finalize_solution(SolverReturn status,Index n, const Number* status_ = status; if(status==0 ||status== 3) { - finalX_ = (double*)malloc(sizeof(double) * numVars_*1); + finalX_ = new double[n]; for (Index i=0; i<numVars_; i++) { finalX_[i] = x[i]; |