Added check to guard against self-assignment

pull/35/head
Jeffrey Walton 2015-07-25 02:02:41 -04:00
parent ed7566fb8d
commit 53eb0f11aa
1 changed files with 2 additions and 0 deletions

View File

@ -427,6 +427,8 @@ byte * ByteQueue::CreatePutSpace(size_t &size)
ByteQueue & ByteQueue::operator=(const ByteQueue &rhs)
{
if(this == &rhs) return *this;
Destroy();
CopyFrom(rhs);
return *this;