diff options
Diffstat (limited to 'cpp/src/Ice/Buffer.cpp')
-rw-r--r-- | cpp/src/Ice/Buffer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cpp/src/Ice/Buffer.cpp b/cpp/src/Ice/Buffer.cpp index b906c99ae74..382f852501f 100644 --- a/cpp/src/Ice/Buffer.cpp +++ b/cpp/src/Ice/Buffer.cpp @@ -87,10 +87,7 @@ IceInternal::Buffer::Container::~Container() void IceInternal::Buffer::Container::swap(Container& other) { - assert(!_buf || _capacity > 0); - std::swap(_buf, other._buf); - std::swap(_size, other._size); std::swap(_capacity, other._capacity); std::swap(_shrinkCounter, other._shrinkCounter); @@ -99,9 +96,10 @@ IceInternal::Buffer::Container::swap(Container& other) void IceInternal::Buffer::Container::clear() { - assert(!_buf || _capacity > 0); - - free(_buf); + if(_buf && _capacity > 0) + { + free(_buf); + } _buf = 0; _size = 0; _capacity = 0; |