diff options
Diffstat (limited to 'src/serialize.h')
-rw-r--r-- | src/serialize.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/serialize.h b/src/serialize.h index f2626281c1..e3d9939bcc 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -789,6 +789,7 @@ struct ser_streamplaceholder +typedef std::vector<char, zero_after_free_allocator<char> > CSerializeData; /** Double ended buffer combining vector and stream-like interfaces. * @@ -798,7 +799,7 @@ struct ser_streamplaceholder class CDataStream { protected: - typedef std::vector<char, zero_after_free_allocator<char> > vector_type; + typedef CSerializeData vector_type; vector_type vch; unsigned int nReadPos; short state; @@ -1095,6 +1096,11 @@ public: ::Unserialize(*this, obj, nType, nVersion); return (*this); } + + void GetAndClear(CSerializeData &data) { + vch.swap(data); + CSerializeData().swap(vch); + } }; |