diff options
| author | Steve Block <steveblock@google.com> | 2010-10-27 15:47:41 +0100 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-10-28 11:12:43 +0100 |
| commit | bf3f67c4fcfd68df256e5c001c67969997a63e28 (patch) | |
| tree | e78cada468d14c9cd244f2f565b90918b7e0bc57 /WebKit/android/jni/WebViewCore.cpp | |
| parent | e59ed3e2c930c8eeed844aa0365e8285d956a8f2 (diff) | |
| download | external_webkit-bf3f67c4fcfd68df256e5c001c67969997a63e28.zip external_webkit-bf3f67c4fcfd68df256e5c001c67969997a63e28.tar.gz external_webkit-bf3f67c4fcfd68df256e5c001c67969997a63e28.tar.bz2 | |
Make sure we delete local references to jclass objects
Change-Id: I1b398bd0a84ce366eb2e686e5f14335d7aa5ed31
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
| -rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 1c903f4..9edc1e2 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -195,6 +195,7 @@ jobject WebViewCore::getApplicationContext() { JNIEnv* env = JSC::Bindings::getJNIEnv(); jclass contextClass = env->GetObjectClass(context); jmethodID appContextMethod = env->GetMethodID(contextClass, "getApplicationContext", "()Landroid/content/Context;"); + env->DeleteLocalRef(contextClass); jobject result = env->CallObjectMethod(context, appContextMethod); checkException(env); return result; @@ -213,6 +214,7 @@ bool WebViewCore::isSupportedMediaMimeType(const WTF::String& mimeType) { bool val = env->CallStaticBooleanMethod(webViewCore, gWebViewCoreStaticMethods.m_isSupportedMediaMimeType, jMimeType); checkException(env); + env->DeleteLocalRef(webViewCore); env->DeleteLocalRef(jMimeType); return val; @@ -378,6 +380,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_setScrollbarModes = GetJMethod(env, clazz, "setScrollbarModes", "(II)V"); m_javaGlue->m_setInstallableWebApp = GetJMethod(env, clazz, "setInstallableWebApp", "()V"); m_javaGlue->m_setWebTextViewAutoFillable = GetJMethod(env, clazz, "setWebTextViewAutoFillable", "(I)V"); + env->DeleteLocalRef(clazz); env->SetIntField(javaWebViewCore, gWebViewCoreFields.m_nativeClass, (jint)this); @@ -4115,6 +4118,8 @@ int registerWebViewCore(JNIEnv* env) LOG_FATAL_IF(gWebViewCoreStaticMethods.m_isSupportedMediaMimeType == NULL, "Could not find static method isSupportedMediaMimeType from WebViewCore"); + env->DeleteLocalRef(widget); + return jniRegisterNativeMethods(env, "android/webkit/WebViewCore", gJavaWebViewCoreMethods, NELEM(gJavaWebViewCoreMethods)); } |
