Skip to content

Commit

Permalink
android: release node-rn 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 react-native in the JNI Environment that's running the node
engine.
  • Loading branch information
jaimecbernardo committed Jun 26, 2018
1 parent fd958ed commit 209f541
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions android/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ void rcv_message(char* msg) {
if(m_sendMessage != nullptr) {
jstring java_msg=env->NewStringUTF(msg);
env->CallStaticVoidMethod(cls2, m_sendMessage,java_msg); // call method
env->DeleteLocalRef(java_msg);
}
}
env->DeleteLocalRef(cls2);
}

// Start threads to redirect stdout and stderr to logcat.
Expand Down

0 comments on commit 209f541

Please sign in to comment.