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) |