Fix assignment operators
This commit is contained in:
parent
a7a811af3a
commit
7777da379d
@ -53,7 +53,9 @@ public:
|
||||
other.IsOwner = false;
|
||||
}
|
||||
|
||||
void operator=(const cChunkBuffer& other)
|
||||
cChunkBuffer& operator=(const cChunkBuffer& other)
|
||||
{
|
||||
if(&other == this)
|
||||
{
|
||||
if(IsOwner)
|
||||
{
|
||||
@ -69,6 +71,8 @@ public:
|
||||
}
|
||||
other.IsOwner = false;
|
||||
}
|
||||
|
||||
}
|
||||
#else
|
||||
// unique_ptr style interface for memory management
|
||||
cChunkBuffer(const cChunkBuffer&& other)
|
||||
@ -79,7 +83,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void operator=(const cChunkBuffer&& other)
|
||||
cChunkBuffer& operator=(const cChunkBuffer&& other)
|
||||
{
|
||||
for (int i = 0; i < CHUNK_SECTION_NUM; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user