summaryrefslogtreecommitdiff
path: root/src/CGALEvaluator.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-11-26 22:31:11 (GMT)
committerMarius Kintel <marius@kintel.net>2011-11-26 22:31:11 (GMT)
commit47bd0b639b4adf4a20f901bd93ac235e77bd2df4 (patch)
tree4f980b1d7cb32a6c87df31f0904196e69b42e2ea /src/CGALEvaluator.cc
parentc6a6ad46da7cb349422eefbec6bf37a55e9f8cc5 (diff)
bugfix: We didn't correctly set back CGAL error behaviour after changing it
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r--src/CGALEvaluator.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc
index 7921b85..78b9c78 100644
--- a/src/CGALEvaluator.cc
+++ b/src/CGALEvaluator.cc
@@ -598,19 +598,20 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps)
}
else // not (this->is2d)
{
+ CGAL_Nef_polyhedron3 *N = NULL;
CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
try {
+ // FIXME: Are we leaking memory for the CGAL_Polyhedron object?
CGAL_Polyhedron *P = createPolyhedronFromPolySet(ps);
if (P) {
- CGAL_Nef_polyhedron3 *N = new CGAL_Nef_polyhedron3(*P);
- return CGAL_Nef_polyhedron(N);
+ N = new CGAL_Nef_polyhedron3(*P);
}
}
catch (CGAL::Assertion_exception e) {
- PRINTF("CGAL error in CGA_Nef_polyhedron3(): %s", e.what());
- CGAL::set_error_behaviour(old_behaviour);
- return CGAL_Nef_polyhedron();
+ PRINTF("CGAL error in CGAL_Nef_polyhedron3(): %s", e.what());
}
+ CGAL::set_error_behaviour(old_behaviour);
+ return CGAL_Nef_polyhedron(N);
}
return CGAL_Nef_polyhedron();
}
contact: Jan Huwald // Impressum