This commit is contained in:
andreika-git 2024-02-22 21:31:47 +02:00 committed by Andrey
parent a1423085e2
commit a0c61a0ebc
1 changed files with 10 additions and 6 deletions

View File

@ -38,13 +38,17 @@ BigBufferHandle::BigBufferHandle(BigBufferHandle&& other) {
}
BigBufferHandle& BigBufferHandle::operator= (BigBufferHandle&& other) {
// swap contents of the two objects
m_bufferPtr = other.m_bufferPtr;
other.m_bufferPtr = nullptr;
m_user = other.m_user;
other.m_user = BigBufferUser::None;
if (this != &other) {
if (m_bufferPtr) {
releaseBuffer(m_bufferPtr, m_user);
}
// swap contents of the two objects
m_bufferPtr = other.m_bufferPtr;
other.m_bufferPtr = nullptr;
m_user = other.m_user;
other.m_user = BigBufferUser::None;
}
return *this;
}