summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/jni/android_media_AudioEffectDescriptor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/jni/android_media_AudioEffectDescriptor.cpp b/core/jni/android_media_AudioEffectDescriptor.cpp
index 37d8114052b8..1435e879053c 100644
--- a/core/jni/android_media_AudioEffectDescriptor.cpp
+++ b/core/jni/android_media_AudioEffectDescriptor.cpp
@@ -102,9 +102,9 @@ void convertAudioEffectDescriptorVectorFromNative(JNIEnv *env, jobjectArray *jDe
*jDescriptors = env->NewObjectArray(actualSize, audioEffectDescriptorClass(), NULL);
for (size_t i = 0; i < actualSize; i++) {
- env->SetObjectArrayElement(*jDescriptors,
- i,
- env->GetObjectArrayElement(temp, i));
+ jobject jdesc = env->GetObjectArrayElement(temp, i);
+ env->SetObjectArrayElement(*jDescriptors, i, jdesc);
+ env->DeleteLocalRef(jdesc);
}
env->DeleteLocalRef(temp);
}