Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't try to release native handle if it's not there

  • Loading branch information...
commit fca24265c9348d69666b8e56c6758a5e4c9f7c81 1 parent 07eee21
@paddybyers authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 bridge-java/src/org/meshpoint/anode/java/Base.java
View
13 bridge-java/src/org/meshpoint/anode/java/Base.java
@@ -25,13 +25,18 @@
* private state
*********************/
long instHandle; /* (long)Persistent<Object>* */
- protected Env env = Env.getCurrent();
+ protected Env env;
protected int type;
/*********************
* private API
*********************/
protected Base(short classId) {
+ this(classId, Env.getCurrent());
+ }
+
+ protected Base(short classId, Env env) {
+ this.env = env;
env.bindInterface(classId);
type = Types.classid2Type(classId);
}
@@ -41,7 +46,11 @@ protected Base(int type) {
}
public void finalize() {
- env.finalizeQueue.put(instHandle, type);
+ if(instHandle != 0)
+ env.finalizeQueue.put(instHandle, type);
}
+ public Env getEnv() {
+ return env;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.