From f1e62d02b0b084069e937fd0ebd387d4ac32451e Mon Sep 17 00:00:00 2001
From: haasj <juergen.haas@unibas.ch>
Date: Tue, 22 Feb 2011 14:32:06 +0100
Subject: [PATCH] fixing cartoon renderer segfault in windows

---
 modules/gfx/src/impl/cartoon_renderer.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/gfx/src/impl/cartoon_renderer.cc b/modules/gfx/src/impl/cartoon_renderer.cc
index d9b4577dd..1403c3891 100644
--- a/modules/gfx/src/impl/cartoon_renderer.cc
+++ b/modules/gfx/src/impl/cartoon_renderer.cc
@@ -302,8 +302,11 @@ void CartoonRenderer::rebuild_spline_obj(IndexedVertexArray& va,
                                       options_->GetStrandThickness()+factor,
                                       options_->GetStrandProfileType(),
                                       options_->GetStrandEcc())); // profile 2 = strand
-    profiles.push_back(profiles.back()); // profile 3==2, strand
-    
+ TraceProfile prof=profiles.back();
+// do not ever change this back to profiles.push_back(profiles.back()); it segfaults on windows
+// or you will meet two new friends of yours :)
+// looks like a compiler bug
+    profiles.push_back(prof); // profile 3==2, strand
     profiles.push_back(get_circ_profile(detail,
                                       1.7*options_->GetStrandWidth()+factor,
                                       1.1*options_->GetStrandThickness()+factor,
-- 
GitLab