Skip to content

Commit

Permalink
Merge branch 'master' into im/windowsci
Browse files Browse the repository at this point in the history
  • Loading branch information
imciner2 authored Mar 30, 2022
2 parents 2d86296 + b98f166 commit 0b93c3a
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions osqp_mex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,17 +308,17 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])

//cleanup temporary structures
// Data
if (data->q) mxFree(data->q);
if (data->l) mxFree(data->l);
if (data->u) mxFree(data->u);
if (Px) mxFree(Px);
if (Pi) mxFree(Pi);
if (Pp) mxFree(Pp);
if (data->P) mxFree(data->P);
if (Ax) mxFree(Ax);
if (Ai) mxFree(Ai);
if (Ap) mxFree(Ap);
if (data->A) mxFree(data->A);
if (data->q) c_free(data->q);
if (data->l) c_free(data->l);
if (data->u) c_free(data->u);
if (Px) c_free(Px);
if (Pi) c_free(Pi);
if (Pp) c_free(Pp);
if (data->P) c_free(data->P);
if (Ax) c_free(Ax);
if (Ai) c_free(Ai);
if (Ap) c_free(Ap);
if (data->A) c_free(data->A);
if (data) mxFree(data);
// Settings
if (settings) mxFree(settings);
Expand Down Expand Up @@ -453,13 +453,13 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
}

// Free vectors
if(!mxIsEmpty(q)) mxFree(q_vec);
if(!mxIsEmpty(l)) mxFree(l_vec);
if(!mxIsEmpty(u)) mxFree(u_vec);
if(!mxIsEmpty(Px)) mxFree(Px_vec);
if(!mxIsEmpty(Ax)) mxFree(Ax_vec);
if(!mxIsEmpty(Px_idx)) mxFree(Px_idx_vec);
if(!mxIsEmpty(Ax_idx)) mxFree(Ax_idx_vec);
if(!mxIsEmpty(q)) c_free(q_vec);
if(!mxIsEmpty(l)) c_free(l_vec);
if(!mxIsEmpty(u)) c_free(u_vec);
if(!mxIsEmpty(Px)) c_free(Px_vec);
if(!mxIsEmpty(Ax)) c_free(Ax_vec);
if(!mxIsEmpty(Px_idx)) c_free(Px_idx_vec);
if(!mxIsEmpty(Ax_idx)) c_free(Ax_idx_vec);

// Report errors (if any)
switch (exitflag) {
Expand Down Expand Up @@ -513,8 +513,8 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
osqp_warm_start(osqpData->work, x_vec, y_vec);

// Free vectors
if(!mxIsEmpty(x)) mxFree(x_vec);
if(!mxIsEmpty(y)) mxFree(y_vec);
if(!mxIsEmpty(x)) c_free(x_vec);
if(!mxIsEmpty(y)) c_free(y_vec);

return;
}
Expand Down Expand Up @@ -544,7 +544,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
osqp_warm_start_x(osqpData->work, x_vec);

// Free vectors
if(!mxIsEmpty(x)) mxFree(x_vec);
if(!mxIsEmpty(x)) c_free(x_vec);

return;
}
Expand Down Expand Up @@ -574,7 +574,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
osqp_warm_start_y(osqpData->work, y_vec);

// Free vectors
if(!mxIsEmpty(y)) mxFree(y_vec);
if(!mxIsEmpty(y)) c_free(y_vec);

return;
}
Expand Down

0 comments on commit 0b93c3a

Please sign in to comment.