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-11-06 10:39:09 +00:00
committed by Lorenzo Sciandra
parent 468161232e
commit 820612207a
@@ -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;
}