From 59cbcf703c407833e4bdb07aa53a8ad6c20c292c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 13 Mar 2012 00:03:56 -0500 Subject: post_t's copy constructor wasn't copying xdata_ --- src/item.h | 2 +- src/post.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/item.h b/src/item.h index 3a9c55bb..e7415918 100644 --- a/src/item.h +++ b/src/item.h @@ -132,7 +132,7 @@ public: TRACE_DTOR(item_t); } - void copy_details(const item_t& item) + virtual void copy_details(const item_t& item) { set_flags(item.flags()); set_state(item.state()); diff --git a/src/post.h b/src/post.h index 7d93b1cc..aecd65cf 100644 --- a/src/post.h +++ b/src/post.h @@ -95,6 +95,7 @@ public: xdata_(post.xdata_) { TRACE_CTOR(post_t, "copy"); + copy_details(post); } virtual ~post_t() { TRACE_DTOR(post_t); @@ -141,6 +142,12 @@ public: std::size_t xact_id() const; std::size_t account_id() const; + virtual void copy_details(const item_t& item) { + const post_t& post(dynamic_cast(item)); + xdata_ = post.xdata_; + item_t::copy_details(item); + } + bool valid() const; struct xdata_t : public supports_flags -- cgit v1.2.3