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