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
This commit is contained in:
olly 2019-10-04 10:08:00 +01:00 committed by Oliver Woodman
parent 495b418fb1
commit 5e090d81b4

View File

@ -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;
}