Fix memory leak in Expressions
parent
dde41ebf05
commit
564d2c5873
|
@ -169,6 +169,12 @@ class ExecutionTrace {
|
|||
content.ptr->reverseAD2(dTdA, jacobians);
|
||||
}
|
||||
|
||||
~ExecutionTrace() {
|
||||
if (kind == Function) {
|
||||
content.ptr->~CallRecord<Dim>();
|
||||
}
|
||||
}
|
||||
|
||||
/// Define type so we can apply it as a meta-function
|
||||
typedef ExecutionTrace<T> type;
|
||||
};
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* @brief unit tests for Expression internals
|
||||
*/
|
||||
|
||||
#include <gtsam/nonlinear/internal/CallRecord.h>
|
||||
#include <gtsam/nonlinear/internal/ExecutionTrace.h>
|
||||
#include <gtsam/geometry/Point2.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue