Skip to content
Permalink
Browse files

[3d] fix inevitable crashes when terrain bounding boxes were shown

The list of vertices just kept growing and growing (and we didn't even need another copy!)

(cherry picked from commit 528c8a6)
  • Loading branch information
wonder-sk authored and nyalldawson committed Nov 7, 2018
1 parent b9a1a6c commit f2607008dd59d253e99231883450787633bb04e4
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/3d/chunks/qgschunkboundsentity_p.cpp
  2. +2 −2 src/3d/chunks/qgschunkboundsentity_p.h
@@ -48,9 +48,9 @@ void LineMeshGeometry::setVertices( const QList<QVector3D> &vertices )
rawVertexArray[idx++] = v.x();
rawVertexArray[idx++] = v.y();
rawVertexArray[idx++] = v.z();
mVertices.append( v );
}

mVertexCount = vertices.count();
mVertexBuffer->setData( vertexBufferData );
}

@@ -67,15 +67,15 @@ class LineMeshGeometry : public Qt3DRender::QGeometry

int vertexCount()
{
return mVertices.size();
return mVertexCount;
}

void setVertices( const QList<QVector3D> &vertices );

private:
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;
QList<QVector3D> mVertices;
int mVertexCount = 0;

};

0 comments on commit f260700

Please sign in to comment.
You can’t perform that action at this time.