Skip to content

Commit

Permalink
Buffer<> swap miss ownMem #1964
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-f committed Oct 30, 2017
1 parent 59e1a11 commit 4bd692c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Foundation/include/Poco/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Foundation/testsuite/src/CoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<char> buffer(16);
Poco::Buffer<char> wrapper(my, sizeof(my));
buffer.swap(wrapper);
}


Expand Down

0 comments on commit 4bd692c

Please sign in to comment.