techoe / ceres-solver

Automatically exported from code.google.com/p/ceres-solver
Other
0 stars 0 forks source link

Prevent double deletion of linear_solver_ordering and inner_iteration_ordering #145

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Since the Options class is a copyable light weight class, it seems 
unproblematic to pass by value. This leads to a double deletion of raw pointers 
linear_solver_ordering and inner_iteration_ordering.

Just to show you I didn't make copies of the options object out of laziness, it 
was the following lines that created an implicit copy:

        Solver solver;
        QFuture<void> future = QtConcurrent::run(&solver, &Solver::Solve, options, problem.data(), &summary);

This can be solved by making Options non-copyable, or by replacing the raw 
pointers by shared pointers.

Original issue reported on code.google.com by bjornpi...@gmail.com on 1 Apr 2014 at 12:22

GoogleCodeExporter commented 9 years ago
Bjorn you are right the options class is a bit of a mess in this regard.  
Ideally we would like Options to be copyable, but ownerships semantics make 
things a bit problematic. I will look into this shortly.

Original comment by sameerag...@google.com on 1 Apr 2014 at 12:46

GoogleCodeExporter commented 9 years ago
Shared ptr is the right thing to do here, we just need to figure out what the 
pre c++11 cross platform story for shared_ptr is.

Original comment by sandwich...@gmail.com on 1 Apr 2014 at 4:22

GoogleCodeExporter commented 9 years ago
https://ceres-solver-review.googlesource.com/#/c/4831/1

Original comment by sameerag...@google.com on 13 Apr 2014 at 9:30

GoogleCodeExporter commented 9 years ago

Original comment by sameerag...@google.com on 26 Apr 2014 at 5:55