Fixes a leaked JNI local reference in MIMETypeRegistry::getMIMETypeForExtension
This method was leaking a Java class object. This caused layout test
fast/dom/prototype-inheritance-2.html to crash because the VM ran out of local
references.
Bug: 2218794
Change-Id: I15d6bb8bf16ec58ecd6470ef63e6cd3635d766ef
diff --git a/WebKit/android/jni/MIMETypeRegistry.cpp b/WebKit/android/jni/MIMETypeRegistry.cpp
index eec7af6..32f387d 100644
--- a/WebKit/android/jni/MIMETypeRegistry.cpp
+++ b/WebKit/android/jni/MIMETypeRegistry.cpp
@@ -52,6 +52,7 @@
jobject mimeType = env->CallStaticObjectMethod(mimeClass,
mimeTypeFromExtension, extString);
String result = android::to_string(env, (jstring) mimeType);
+ env->DeleteLocalRef(mimeClass);
env->DeleteLocalRef(extString);
env->DeleteLocalRef(mimeType);
return result;