From 5e090d81b41f8c6dfcb20dc641fe720e97f01cfb Mon Sep 17 00:00:00 2001 From: olly Date: Fri, 4 Oct 2019 10:08:00 +0100 Subject: [PATCH] Remove unnecessary DeleteLocalRef usage Keeping the ones inside loops, because theoretically they can be useful there (in practice, for this use case, it's highly unlikely to make any difference). PiperOrigin-RevId: 272834073 --- extensions/flac/src/main/jni/flac_jni.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/extensions/flac/src/main/jni/flac_jni.cc b/extensions/flac/src/main/jni/flac_jni.cc index d60a7cead2..134b13ccc2 100644 --- a/extensions/flac/src/main/jni/flac_jni.cc +++ b/extensions/flac/src/main/jni/flac_jni.cc @@ -46,7 +46,6 @@ class JavaDataSource : public DataSource { if (mid == NULL) { jclass cls = env->GetObjectClass(flacDecoderJni); mid = env->GetMethodID(cls, "read", "(Ljava/nio/ByteBuffer;)I"); - env->DeleteLocalRef(cls); } } @@ -57,7 +56,6 @@ class JavaDataSource : public DataSource { // Exception is thrown in Java when returning from the native call. result = -1; } - env->DeleteLocalRef(byteBuffer); return result; }