summaryrefslogtreecommitdiff
path: root/src/CGALEvaluator.cc
diff options
context:
space:
mode:
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