Skip to content

Commit

Permalink
android: release node-cordova JNI local references
Browse files Browse the repository at this point in the history
Releases the JNI local references created by messages sent from
node to cordova in the JNI Environment that's running the node
engine.
  • Loading branch information
jaimecbernardo committed Jun 5, 2018
1 parent 6a5b842 commit 05eb3cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/android/jni/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05eb3cf

Please sign in to comment.