Bugfix: rare crash when loading 3D preview. #3636

This commit is contained in:
Alessandro Ranellucci 2016-12-22 13:18:22 +01:00
parent cb72afc10e
commit 73763a8417

View File

@ -8,6 +8,8 @@ _3DScene::_extrusionentity_to_verts_do(const Lines &lines, const std::vector<dou
const std::vector<double> &heights, bool closed, double top_z, const Point &copy, const std::vector<double> &heights, bool closed, double top_z, const Point &copy,
GLVertexArray* qverts, GLVertexArray* tverts) GLVertexArray* qverts, GLVertexArray* tverts)
{ {
if (lines.empty()) return;
/* It looks like it's faster without reserving capacity... /* It looks like it's faster without reserving capacity...
// each segment has 4 quads, thus 16 vertices; + 2 caps // each segment has 4 quads, thus 16 vertices; + 2 caps
qverts->reserve_more(3 * 4 * (4 * lines.size() + 2)); qverts->reserve_more(3 * 4 * (4 * lines.size() + 2));