Incorrect ref API usage fixed. (#20913)

Summary:
release method of local_ref and global_ref doesn't call deallocator, in fact, it leaves the caller responsible for deletion of the reference, while otherwise the reference is released on scope left.

Fixes #18292.
Pull Request resolved: https://github.com/facebook/react-native/pull/20913

Differential Revision: D9616237

Pulled By: hramos

fbshipit-source-id: 021aa3e4f039e6b7a98da3e4224c1ee49d5a4921
This commit is contained in:
Sergei Dryganets 2018-08-31 12:33:28 -07:00 committed by Facebook Github Bot
parent 792cd0902e
commit 09c78fe968
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ local_ref<JArrayClass<jobject>> ReadableNativeArray::importTypeArray() {
jint size = array_.size();
auto jarray = JArrayClass<jobject>::newArray(size);
for (jint i = 0; i < size; i++) {
jarray->setElement(i, ReadableNativeArray::getType(i).release());
jarray->setElement(i, ReadableNativeArray::getType(i).get());
}
return jarray;
}