Skip to content

Commit b083c29

Browse files
committed
gh-279 Fix catch in Cursor ctor
1 parent 0729728 commit b083c29

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/main/java/org/lmdbjava/Cursor.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ public final class Cursor<T> implements AutoCloseable {
6161
try {
6262
this.kv = txn.newKeyVal();
6363
} catch (final Exception e) {
64+
closed.set(true);
6465
this.refCounterReleaser.release();
65-
closed.set(false);
66+
// Clean up the native cursor
67+
LIB.mdb_cursor_close(ptrCursor);
6668
throw e;
6769
}
6870
}

0 commit comments

Comments
 (0)