1
0

Fix assignment operators

This commit is contained in:
worktycho 2014-05-17 14:04:44 +01:00
parent a7a811af3a
commit 7777da379d

View File

@ -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++)
{