diff --git a/examples/java/JavaExample.java b/examples/java/JavaExample.java index 74e94617d..5c8a7508f 100644 --- a/examples/java/JavaExample.java +++ b/examples/java/JavaExample.java @@ -188,7 +188,7 @@ class JavaExample /* do something with the context */ /* be kind to dispose manually and not wait for the GC. */ - ctx.dispose(); + ctx.close(); } } diff --git a/src/api/java/Context.java b/src/api/java/Context.java index 39d35d9d3..da924026c 100644 --- a/src/api/java/Context.java +++ b/src/api/java/Context.java @@ -35,6 +35,11 @@ public class Context implements AutoCloseable { init(); } + protected Context (long m_ctx) { + this.m_ctx = m_ctx; + init(); + } + /** * Constructor.