From 4bd692ca38fbf58a50a42659586bea2c5ff6d7b6 Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Mon, 30 Oct 2017 15:23:54 -0500 Subject: [PATCH] Buffer<> swap miss ownMem #1964 --- Foundation/include/Poco/Buffer.h | 1 + Foundation/testsuite/src/CoreTest.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Foundation/include/Poco/Buffer.h b/Foundation/include/Poco/Buffer.h index 4e5733db72..6e3395e0a0 100644 --- a/Foundation/include/Poco/Buffer.h +++ b/Foundation/include/Poco/Buffer.h @@ -257,6 +257,7 @@ class Buffer swap(_ptr, other._ptr); swap(_capacity, other._capacity); swap(_used, other._used); + swap(_ownMem, other._ownMem); } bool operator == (const Buffer& other) const diff --git a/Foundation/testsuite/src/CoreTest.cpp b/Foundation/testsuite/src/CoreTest.cpp index 2eef271b29..59845f13a3 100644 --- a/Foundation/testsuite/src/CoreTest.cpp +++ b/Foundation/testsuite/src/CoreTest.cpp @@ -348,6 +348,11 @@ void CoreTest::testBuffer() k.append('d'); assert (k.size() == 15); assert ( !std::memcmp(k.begin(), "hellohelloworld", k.size()) ); + + char my[16]; + Poco::Buffer buffer(16); + Poco::Buffer wrapper(my, sizeof(my)); + buffer.swap(wrapper); }