From d744f46a139627d25c9112bfd4e60e40e24f7de5 Mon Sep 17 00:00:00 2001 From: Roelof Oomen Date: Fri, 8 Dec 2023 07:57:16 +0100 Subject: [PATCH] Fixes two forgotten csc_spfree calls --- trajopt_optimizers/trajopt_sqp/src/osqp_eigen_solver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trajopt_optimizers/trajopt_sqp/src/osqp_eigen_solver.cpp b/trajopt_optimizers/trajopt_sqp/src/osqp_eigen_solver.cpp index bc08e5af..d5709267 100644 --- a/trajopt_optimizers/trajopt_sqp/src/osqp_eigen_solver.cpp +++ b/trajopt_optimizers/trajopt_sqp/src/osqp_eigen_solver.cpp @@ -312,7 +312,7 @@ bool OSQPEigenSolver::updateLinearConstraintsMatrix(const SparseMatrix& linearCo bool success = solver_.updateLinearConstraintsMatrix(cleaned); if (cleaned.nonZeros() == 0) /** @todo Remove when upgrading to OSQP 1.0.0 */ { - csc_spfree(solver_.data()->getData()->A); + csc_spfree_fix(solver_.data()->getData()->A); solver_.data()->getData()->A = nullptr; solver_.data()->getData()->A = csc_spalloc_fix(cleaned.rows(), cleaned.cols(), 0, 1, 0); } @@ -322,7 +322,7 @@ bool OSQPEigenSolver::updateLinearConstraintsMatrix(const SparseMatrix& linearCo bool success = solver_.data()->setLinearConstraintsMatrix(cleaned); if (cleaned.nonZeros() == 0) /** @todo Remove when upgrading to OSQP 1.0.0 */ { - csc_spfree(solver_.data()->getData()->A); + csc_spfree_fix(solver_.data()->getData()->A); solver_.data()->getData()->A = nullptr; solver_.data()->getData()->A = csc_spalloc_fix(cleaned.rows(), cleaned.cols(), 0, 1, 0); }