jintArray endpointArray = env->NewIntArray(length);
env->SetIntArrayRegion(endpointArray, 0, length, endpointValues.array());
+ jstring deviceName = env->NewStringUTF(devname);
env->CallVoidMethod(thiz, method_usbDeviceAdded,
- env->NewStringUTF(devname), vendorId, productId, deviceClass,
+ deviceName, vendorId, productId, deviceClass,
deviceSubClass, protocol, interfaceArray, endpointArray);
+
+ env->DeleteLocalRef(interfaceArray);
+ env->DeleteLocalRef(endpointArray);
+ env->DeleteLocalRef(deviceName);
checkAndClearExceptionFromCallback(env, __FUNCTION__);
return 0;
JNIEnv* env = AndroidRuntime::getJNIEnv();
jobject thiz = (jobject)client_data;
+ jstring deviceName = env->NewStringUTF(devname);
env->CallVoidMethod(thiz, method_usbDeviceRemoved, env->NewStringUTF(devname));
+ env->DeleteLocalRef(deviceName);
checkAndClearExceptionFromCallback(env, __FUNCTION__);
return 0;
}