JniOnUnload

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class JniOnUnload(source)

The function annotated with this annotation will be called when the class loader containing the native library is garbage collected.

This is useful for cleanup operations. Because this function is called in an unknown context (such as from a finalizer), the programmer should be conservative on using Java VM services and refrain from arbitrary Java call-backs.

Annotated function must be top-level and have no or single parameter of type JavaVM.