Unregister all native methods on unload for kqueue (#10738)

Motivation:

03aafb9cff did ensure we unregister all native methods when we unload / or fail during load of the native library. Unfortunally it missed to unregister in one case for kqueue.

Modifications:

Add unregister calls to the unload function

Result:

Correctly unregister in all cases
This commit is contained in:
Norman Maurer 2020-10-28 13:08:22 +01:00 committed by GitHub
parent fe5a9f3e32
commit 701eed8762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -371,14 +371,17 @@ error:
return JNI_ERR;
}
static void netty_kqueue_native_JNI_OnUnLoad(JNIEnv* env, const char* staticPackagePrefix) {
netty_unix_limits_JNI_OnUnLoad(env, staticPackagePrefix);
netty_unix_errors_JNI_OnUnLoad(env, staticPackagePrefix);
netty_unix_filedescriptor_JNI_OnUnLoad(env, staticPackagePrefix);
netty_unix_socket_JNI_OnUnLoad(env, staticPackagePrefix);
netty_unix_buffer_JNI_OnUnLoad(env, staticPackagePrefix);
netty_kqueue_bsdsocket_JNI_OnUnLoad(env, staticPackagePrefix);
netty_kqueue_eventarray_JNI_OnUnLoad(env, staticPackagePrefix);
static void netty_kqueue_native_JNI_OnUnLoad(JNIEnv* env, const char* packagePrefix) {
netty_unix_util_unregister_natives(env, packagePrefix, STATICALLY_CLASSNAME);
netty_unix_util_unregister_natives(env, packagePrefix, NATIVE_CLASSNAME);
netty_unix_limits_JNI_OnUnLoad(env, packagePrefix);
netty_unix_errors_JNI_OnUnLoad(env, packagePrefix);
netty_unix_filedescriptor_JNI_OnUnLoad(env, packagePrefix);
netty_unix_socket_JNI_OnUnLoad(env, packagePrefix);
netty_unix_buffer_JNI_OnUnLoad(env, packagePrefix);
netty_kqueue_bsdsocket_JNI_OnUnLoad(env, packagePrefix);
netty_kqueue_eventarray_JNI_OnUnLoad(env, packagePrefix);
}
static jint JNI_OnLoad_netty_transport_native_kqueue0(JavaVM* vm, void* reserved) {