Merge pull request #758 from borglab/fix-potential-crash
Avoid potential wrong memory accessrelease/4.3a0
commit
6097b8f8e5
|
|
@ -355,7 +355,7 @@ class FactorGraph {
|
||||||
|
|
||||||
/** delete factor without re-arranging indexes by inserting a nullptr pointer
|
/** delete factor without re-arranging indexes by inserting a nullptr pointer
|
||||||
*/
|
*/
|
||||||
void remove(size_t i) { factors_[i].reset(); }
|
void remove(size_t i) { factors_.at(i).reset(); }
|
||||||
|
|
||||||
/** replace a factor by index */
|
/** replace a factor by index */
|
||||||
void replace(size_t index, sharedFactor factor) { at(index) = factor; }
|
void replace(size_t index, sharedFactor factor) { at(index) = factor; }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue