From 73763a8417751b6f45e71cebad6bf4a8a8827993 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 22 Dec 2016 13:18:22 +0100 Subject: [PATCH] Bugfix: rare crash when loading 3D preview. #3636 --- xs/src/slic3r/GUI/3DScene.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xs/src/slic3r/GUI/3DScene.cpp b/xs/src/slic3r/GUI/3DScene.cpp index e398a1c37..519f96aa9 100644 --- a/xs/src/slic3r/GUI/3DScene.cpp +++ b/xs/src/slic3r/GUI/3DScene.cpp @@ -8,6 +8,8 @@ _3DScene::_extrusionentity_to_verts_do(const Lines &lines, const std::vector &heights, bool closed, double top_z, const Point ©, GLVertexArray* qverts, GLVertexArray* tverts) { + if (lines.empty()) return; + /* It looks like it's faster without reserving capacity... // each segment has 4 quads, thus 16 vertices; + 2 caps qverts->reserve_more(3 * 4 * (4 * lines.size() + 2));