diff --git a/gtsam/inference/SymbolicFactorGraph.cpp b/gtsam/inference/SymbolicFactorGraph.cpp index b58a69b6d..00f3439a0 100644 --- a/gtsam/inference/SymbolicFactorGraph.cpp +++ b/gtsam/inference/SymbolicFactorGraph.cpp @@ -85,8 +85,8 @@ namespace gtsam { "IndexFactor::CombineAndEliminate called on factors with no variables."); vector newKeys(keys.begin(), keys.end()); - return make_pair(new IndexConditional(newKeys, nrFrontals), - new IndexFactor(newKeys.begin() + nrFrontals, newKeys.end())); + return make_pair(boost::make_shared(newKeys, nrFrontals), + boost::make_shared(newKeys.begin() + nrFrontals, newKeys.end())); } /* ************************************************************************* */