Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop 1.0 #55

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open

Develop 1.0 #55

wants to merge 40 commits into from

Conversation

AmitSolomonPrinceton
Copy link
Collaborator

Added support to codegen, changes to c_source, memory,

AmitSolomonPrinceton and others added 30 commits August 21, 2023 12:08
…s through the API. Also reversed the change to .gitmodules.
Comment on lines +255 to +166
if (!strcmp("delete", cmd)) {
osqp_cleanup(osqpData->solver);
destroyObject<OsqpData>(prhs[1]);
// Warn if other commands were ignored
if (nlhs != 0 || nrhs != 2)
mexWarnMsgTxt("Delete: Unexpected arguments ignored.");
return;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about this. During the constructor ("new"), I dynamically create a new OSQPCodegenDefines object (see Line 159). Seeing how osqp_cleanup destroys osqpData->solver, I thought I would have to free osqpData->defines manually. However, when I did that, the program crashed because destroyObject tries to destroy the already freed memory. What I don't understand is why this doesn't happen with osqpData->solver, which is freed by osqp_cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants