From 05eb3cf75689dd223409691f281cd9f6ce8af102 Mon Sep 17 00:00:00 2001 From: Jaime Bernardo Date: Mon, 4 Jun 2018 10:22:40 +0100 Subject: [PATCH] android: release node-cordova JNI local references Releases the JNI local references created by messages sent from node to cordova in the JNI Environment that's running the node engine. --- src/android/jni/native-lib.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/android/jni/native-lib.cpp b/src/android/jni/native-lib.cpp index 2bbd71f..3207573 100644 --- a/src/android/jni/native-lib.cpp +++ b/src/android/jni/native-lib.cpp @@ -90,8 +90,11 @@ void rcv_message_from_node(const char* channel_name, const char* msg) { jstring java_msg=env->NewStringUTF(msg); // Call the method. env->CallStaticVoidMethod(cls2, m_sendMessage, java_channel_name, java_msg); + env->DeleteLocalRef(java_channel_name); + env->DeleteLocalRef(java_msg); } } + env->DeleteLocalRef(cls2); } extern "C" jint JNICALL