From 09c78fe968e1bb71108c4058e76ebf70178e5a8b Mon Sep 17 00:00:00 2001 From: Sergei Dryganets Date: Fri, 31 Aug 2018 12:33:28 -0700 Subject: [PATCH] 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 --- ReactAndroid/src/main/jni/react/jni/ReadableNativeArray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/jni/react/jni/ReadableNativeArray.cpp b/ReactAndroid/src/main/jni/react/jni/ReadableNativeArray.cpp index 008738f6af2a67..6d7a33c1062b63 100644 --- a/ReactAndroid/src/main/jni/react/jni/ReadableNativeArray.cpp +++ b/ReactAndroid/src/main/jni/react/jni/ReadableNativeArray.cpp @@ -113,7 +113,7 @@ local_ref> ReadableNativeArray::importTypeArray() { jint size = array_.size(); auto jarray = JArrayClass::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; }