summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-02-21 05:10:33 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-21 05:10:33 -0800
commit8683b0167bd87fe3da0d70a37a1be86eaf561106 (patch)
tree2ef958fc648c7e5d0ce42866e97255c7a768dbce /WebKit/android/jni/WebViewCore.cpp
parent99bdc8c1518fd15e567c7d6bc9d784e12abfdc4b (diff)
parent2d40c8d707d6a815f49000e2a1575b059a68e9a9 (diff)
downloadexternal_webkit-8683b0167bd87fe3da0d70a37a1be86eaf561106.zip
external_webkit-8683b0167bd87fe3da0d70a37a1be86eaf561106.tar.gz
external_webkit-8683b0167bd87fe3da0d70a37a1be86eaf561106.tar.bz2
Merge "Fix a leaked JNI LocaRef in WebViewCore::jsPrompt()"
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 6e6196a..66c78b5 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -3385,13 +3385,13 @@ bool WebViewCore::jsConfirm(const WTF::String& url, const WTF::String& text)
bool WebViewCore::jsPrompt(const WTF::String& url, const WTF::String& text, const WTF::String& defaultValue, WTF::String& result)
{
JNIEnv* env = JSC::Bindings::getJNIEnv();
+ jstring jUrlStr = wtfStringToJstring(env, url);
jstring jInputStr = wtfStringToJstring(env, text);
jstring jDefaultStr = wtfStringToJstring(env, defaultValue);
- jstring jUrlStr = wtfStringToJstring(env, url);
jstring returnVal = static_cast<jstring>(env->CallObjectMethod(m_javaGlue->object(env).get(), m_javaGlue->m_jsPrompt, jUrlStr, jInputStr, jDefaultStr));
+ env->DeleteLocalRef(jUrlStr);
env->DeleteLocalRef(jInputStr);
env->DeleteLocalRef(jDefaultStr);
- env->DeleteLocalRef(jUrlStr);
checkException(env);
// If returnVal is null, it means that the user cancelled the dialog.
@@ -3399,6 +3399,7 @@ bool WebViewCore::jsPrompt(const WTF::String& url, const WTF::String& text, cons
return false;
result = jstringToWtfString(env, returnVal);
+ env->DeleteLocalRef(returnVal);
return true;
}