33 private final long nativeRef;
34 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
36 private CppProxy(
long nativeRef)
38 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
39 this.nativeRef = nativeRef;
42 private native
void nativeDestroy(
long nativeRef);
43 public void _djinni_private_destroy()
45 boolean destroyed = this.destroyed.getAndSet(
true);
46 if (!destroyed) nativeDestroy(this.nativeRef);
48 protected void finalize() throws
java.lang.Throwable
50 _djinni_private_destroy();
59 assert !this.destroyed.get() :
"trying to use a destroyed object";
60 return native_createRouteSession(this.nativeRef, wayPoint, routeOptions);
67 assert !this.destroyed.get() :
"trying to use a destroyed object";
68 native_cancelRouteSession(this.nativeRef, session);
70 private native
void native_cancelRouteSession(
long _nativeRef,
RouteSession session);