Skip to content

Commit

Permalink
Added check to guard against self-assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Jul 25, 2015
1 parent ed7566f commit 53eb0f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 53eb0f1

Please sign in to comment.