Skip to content

Commit 34fcb39

Browse files
committed
pass the exception up
1 parent dc633d7 commit 34fcb39

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

bindings/java/src/main/java/com/cadoodlecad/manifold/ManifoldBindings.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public ManifoldBindings(File cacheDirectory) throws Exception {
294294
ValueLayout.ADDRESS, ValueLayout.JAVA_INT, ValueLayout.JAVA_INT);
295295
// ManifoldPolygons* manifold_alloc_polygons();
296296
load("manifold_alloc_polygons", ValueLayout.ADDRESS);
297-
297+
298298
// ===== Analysis =====
299299

300300
// double manifold_volume(ManifoldManifold* m);
@@ -497,7 +497,7 @@ public ArrayList<double[][]> slice(MemorySegment m, double height) throws Throwa
497497
try (Arena arena = Arena.ofConfined()) {
498498
MemorySegment mem = (MemorySegment) functions.get("manifold_alloc_polygons").invoke();
499499
polygons = (MemorySegment) functions.get("manifold_slice").invoke(mem, m, height);
500-
500+
501501
long numContours = (long) functions.get("manifold_polygons_num_contour").invoke(polygons);
502502
ArrayList<double[][]> result = new ArrayList<double[][]>((int) numContours);
503503

@@ -516,10 +516,7 @@ public ArrayList<double[][]> slice(MemorySegment m, double height) throws Throwa
516516
return result;
517517
} finally {
518518
if (polygons != null) {
519-
try {
520-
functions.get("manifold_delete_polygons").invoke(polygons);
521-
} catch (Throwable ignored) {
522-
}
519+
functions.get("manifold_delete_polygons").invoke(polygons);
523520
}
524521
}
525522
}

0 commit comments

Comments
 (0)