From efa7cbc079a29b0a7b5912900b504ee828da8b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 2 Nov 2012 12:38:52 +0100 Subject: [PATCH] Fixed Mesh move constructor and move assignment operator. Forgot to move integer and long attributes. Also using move instead of copy for vectors. --- src/Mesh.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 1fe2c3919..927d2c38e 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -43,7 +43,7 @@ Mesh::~Mesh() { (this->*destroyImplementation)(); } -Mesh::Mesh(Mesh&& other): vao(other.vao), _primitive(other._primitive), _vertexCount(other._vertexCount), attributes(other.attributes) { +Mesh::Mesh(Mesh&& other): vao(other.vao), _primitive(other._primitive), _vertexCount(other._vertexCount), attributes(std::move(other.attributes)), integerAttributes(std::move(other.integerAttributes)), longAttributes(std::move(other.longAttributes)) { other.vao = 0; } @@ -53,7 +53,9 @@ Mesh& Mesh::operator=(Mesh&& other) { vao = other.vao; _primitive = other._primitive; _vertexCount = other._vertexCount; - attributes = other.attributes; + attributes = std::move(other.attributes); + integerAttributes = std::move(other.integerAttributes); + longAttributes = std::move(other.longAttributes); other.vao = 0;