summaryrefslogtreecommitdiff
path: root/src/runtime/java/org
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-08-29 05:38:07 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-08-29 05:38:07 +0000
commit1da6b2a34a29b591ba3765887a981e23e5605fbe (patch)
tree6cb226d3ed4d5b42989bae4fcca6980da7720a85 /src/runtime/java/org
parentbb007630d7a82210cbd0d78eab893e4f3b22679c (diff)
the PGF class is now using the new Pool class to manage the life time of the memory allocated in C.
Diffstat (limited to 'src/runtime/java/org')
-rw-r--r--src/runtime/java/org/grammaticalframework/pgf/PGF.java15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/runtime/java/org/grammaticalframework/pgf/PGF.java b/src/runtime/java/org/grammaticalframework/pgf/PGF.java
index 6bbe5590a..d97a952a2 100644
--- a/src/runtime/java/org/grammaticalframework/pgf/PGF.java
+++ b/src/runtime/java/org/grammaticalframework/pgf/PGF.java
@@ -26,24 +26,13 @@ public class PGF {
//////////////////////////////////////////////////////////////////
// private stuff
-
- private static native void free(long pool);
-
- private long pool;
+ private Pool pool;
private long ref;
private PGF(long pool, long ref) {
- this.pool = pool;
+ this.pool = new Pool(pool);
this.ref = ref;
}
-
- protected void finalize () throws Throwable {
- if (pool != 0) {
- free(pool);
- pool = 0;
- ref = 0;
- }
- }
static {
System.loadLibrary("jpgf");