From bdfa72e0e9ab26723b791a3375e17e741a5e11fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Aug 2014 16:19:12 +0200 Subject: [PATCH] Fix Buffer move construction/assignment on NaCl. --- src/Magnum/Buffer.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Buffer.h b/src/Magnum/Buffer.h index d627700d7..f3697b092 100644 --- a/src/Magnum/Buffer.h +++ b/src/Magnum/Buffer.h @@ -937,13 +937,24 @@ CORRADE_ENUMSET_OPERATORS(Buffer::MapFlags) /** @debugoperatorclassenum{Magnum::Buffer,Magnum::Buffer::Target} */ Debug MAGNUM_EXPORT operator<<(Debug debug, Buffer::Target value); -inline Buffer::Buffer(Buffer&& other) noexcept: _id{other._id}, _targetHint{other._targetHint}, _created{other._created} { +inline Buffer::Buffer(Buffer&& other) noexcept: _id{other._id}, _targetHint{other._targetHint}, + #ifdef CORRADE_TARGET_NACL + _mappedBuffer{other._mappedBuffer}, + #endif + _created{other._created} +{ other._id = 0; + #ifdef CORRADE_TARGET_NACL + other._mappedBuffer = nullptr; + #endif } inline Buffer& Buffer::operator=(Buffer&& other) noexcept { std::swap(_id, other._id); std::swap(_targetHint, other._targetHint); + #ifdef CORRADE_TARGET_NACL + std::swap(_mappedBuffer, other._mappedBuffer); + #endif std::swap(_created, other._created); return *this; }