35 private final long nativeRef;
36 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
38 private CppProxy(
long nativeRef)
40 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
41 this.nativeRef = nativeRef;
44 private native
void nativeDestroy(
long nativeRef);
45 public void _djinni_private_destroy()
47 boolean destroyed = this.destroyed.getAndSet(
true);
48 if (!destroyed) nativeDestroy(this.nativeRef);
50 protected void finalize() throws
java.lang.Throwable
52 _djinni_private_destroy();
61 assert !this.destroyed.get() :
"trying to use a destroyed object";
62 return native_getPoint(this.nativeRef);
64 private native
LocationPoint native_getPoint(
long _nativeRef);
69 assert !this.destroyed.get() :
"trying to use a destroyed object";
70 return native_getMapObject(this.nativeRef);
72 private native
MapObject native_getMapObject(
long _nativeRef);