51 private final long nativeRef;
52 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
54 private CppProxy(
long nativeRef)
56 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
57 this.nativeRef = nativeRef;
60 private native
void nativeDestroy(
long nativeRef);
61 public void _djinni_private_destroy()
63 boolean destroyed = this.destroyed.getAndSet(
true);
64 if (!destroyed) nativeDestroy(this.nativeRef);
66 protected void finalize() throws
java.lang.Throwable
68 _djinni_private_destroy();
77 assert !this.destroyed.get() :
"trying to use a destroyed object";
78 return native_getPoint(this.nativeRef);
80 private native
LocationPoint native_getPoint(
long _nativeRef);
85 assert !this.destroyed.get() :
"trying to use a destroyed object";
86 return native_getMapObject(this.nativeRef);
88 private native
MapObject native_getMapObject(
long _nativeRef);