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

ConditionedCostFunction does not allow duplicate cost function pointers. #422

Closed
csukuangfj opened this issue Sep 21, 2018 · 1 comment
Closed
Assignees

Comments

@csukuangfj
Copy link
Contributor

csukuangfj commented Sep 21, 2018

See the code

if (ownership_ == TAKE_OWNERSHIP) {
STLDeleteElements(&conditioners_);
} else {

while (begin != end) {
ForwardIterator temp = begin;
++begin;
delete *temp;

It causes runtime errors when

std::vector<CostFunction*> conditioners_;

contains duplicate pointers since they are freed multiple times.

@sandwichmaker sandwichmaker self-assigned this Sep 21, 2018
@sandwichmaker
Copy link
Contributor

keir pushed a commit that referenced this issue Sep 25, 2018
If the user uses the same conditioner twice, it does not lead
to a double free errors.

#422

Change-Id: I9041ddcbffa8dcb882a63bddb82b384897efc970
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

No branches or pull requests

2 participants