From ba02f0a45036a1f9c64cd56533990d3284bcc4cf Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 10 Aug 2008 01:41:59 -0400 Subject: Fixed a memory leak that would show up if --verify --verbose was running and an error or exception occurred. --- src/xact.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/xact.h') diff --git a/src/xact.h b/src/xact.h index 5d4950f9..bb2f1e23 100644 --- a/src/xact.h +++ b/src/xact.h @@ -155,10 +155,22 @@ public: optional component_xacts; xdata_t() : supports_flags<>(), index(0), account(NULL), ptr(NULL) { - TRACE_CTOR(xdata_t, ""); + TRACE_CTOR(xact_t::xdata_t, ""); + } + xdata_t(const xdata_t& other) + : supports_flags<>(other.flags()), + total(other.total), + sort_value(other.sort_value), + value(other.value), + index(other.index), + date(other.date), + account(other.account), + ptr(NULL) + { + TRACE_CTOR(xact_t::xdata_t, "copy"); } ~xdata_t() throw() { - TRACE_DTOR(xdata_t); + TRACE_DTOR(xact_t::xdata_t); } void remember_xact(xact_t& xact) { -- cgit v1.2.3