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: More formatting issues Created Feb. 4, 2015, 12:03 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..e0ffc2cf3ff1b9a61c4626faf206232c3b2f0f5e 100644
--- a/jni/JniFilter.cpp
+++ b/jni/JniFilter.cpp
@@ -66,9 +66,10 @@ 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