Index: jni/JniEventCallback.cpp |
diff --git a/jni/JniEventCallback.cpp b/jni/JniEventCallback.cpp |
index c92a48845b979d9ae45a52bfaa33e0e9494625de..4a0c3861fc5b3f94ee3bef82b7465e5fcc92604e 100644 |
--- a/jni/JniEventCallback.cpp |
+++ b/jni/JniEventCallback.cpp |
@@ -40,8 +40,9 @@ void JniEventCallback::Callback(AdblockPlus::JsValueList& params) |
{ |
JNIEnvAcquire env(GetJavaVM()); |
- jclass clazz = env->GetObjectClass(GetCallbackObject()); |
- jmethodID method = env->GetMethodID(clazz, "eventCallback", "(Ljava/util/List;)V"); |
+ jmethodID method = env->GetMethodID( |
+ *JniLocalReference<jclass>(*env, env->GetObjectClass(GetCallbackObject())), |
+ "eventCallback", "(Ljava/util/List;)V"); |
if (method) |
{ |