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

Made ConstraintSolver obey C++11 ownership conventions #616

Merged
merged 3 commits into from
Feb 23, 2016

Conversation

mkoval
Copy link
Collaborator

@mkoval mkoval commented Feb 22, 2016

constraint::ConstraintSolver takes ownership of the setCollisionDetector passed in to setCollisionDetector. This is not clear from the API because the function accepts a raw pointer. This leads to a SEGFAULT if you do not expect ConstraintSolver to delete your CollisionDetector.

I modified setCollisionDetector to take an unique_ptr to make the ownership transfer explicit. I also switched to storing the LCPSolver in a unique_ptr to remove the other manual delete from the ConstraintSolver destructor.

@jslee02 jslee02 added this to the DART 6.0.0 milestone Feb 23, 2016
@jslee02
Copy link
Member

jslee02 commented Feb 23, 2016

👍

jslee02 added a commit that referenced this pull request Feb 23, 2016
Made ConstraintSolver obey C++11 ownership conventions
@jslee02 jslee02 merged commit a34307e into dartsim:master Feb 23, 2016
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