src/main/c/Posix/SerialPort_Posix.c [352:369]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - classInitialized = 1; return jniVersion; } JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *jvm, void *reserved) { // Ensure that the class has not already been uninitialized if (!classInitialized) return; classInitialized = 0; // Retrieve the JNI environment JNIEnv *env; jint jniVersion = JNI_VERSION_1_2; (*jvm)->GetEnv(jvm, (void**)&env, jniVersion); // Close all open ports for (int i = 0; i < serialPorts.length; ++i) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - src/main/c/Windows/SerialPort_Windows.c [707:724]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - classInitialized = 1; return jniVersion; } JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *jvm, void *reserved) { // Ensure that the class has not already been uninitialized if (!classInitialized) return; classInitialized = 0; // Retrieve the JNI environment JNIEnv *env; jint jniVersion = JNI_VERSION_1_2; (*jvm)->GetEnv(jvm, (void**)&env, jniVersion); // Close all open ports for (int i = 0; i < serialPorts.length; ++i) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -