Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: jni/JniFilter.cpp

Issue 4761138508070912: Issue 1848 - Clean up local reference handling (Closed)
Patch Set: Created Jan. 22, 2015, 6:53 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « jni/JniEventCallback.cpp ('k') | jni/JniFilterChangeCallback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jni/JniFilter.cpp
diff --git a/jni/JniFilter.cpp b/jni/JniFilter.cpp
index 9f72448496bc9ab0722a91cbdfe247824715c307..013a31f3f2d1f382edf58ccf95744073f75e09ca 100644
--- a/jni/JniFilter.cpp
+++ b/jni/JniFilter.cpp
@@ -66,9 +66,9 @@ static jobject JNICALL JniGetType(JNIEnv* env, jclass clazz, jlong ptr)
break;
}
- jclass enumClass = env->FindClass(PKG("Filter$Type"));
- jfieldID enumField = env->GetStaticFieldID(enumClass, enumName, TYP("Filter$Type"));
- return env->GetStaticObjectField(enumClass, enumField);
+ JniLocalReference<jclass> enumClass(env, env->FindClass(PKG("Filter$Type")));
+ jfieldID enumField = env->GetStaticFieldID(*enumClass, enumName, TYP("Filter$Type"));
+ return env->GetStaticObjectField(*enumClass, enumField);
}
static jboolean JNICALL JniIsListed(JNIEnv* env, jclass clazz, jlong ptr)
« no previous file with comments | « jni/JniEventCallback.cpp ('k') | jni/JniFilterChangeCallback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld