Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
Avoid leaking JNI local references in UrlInterceptResponse
Browse files Browse the repository at this point in the history
Bug: 4509854
Change-Id: I70bd6b5f1ce32263b1f048a7bb5e732338e7297d
  • Loading branch information
Steve Block committed Jul 6, 2011
1 parent 63cbafa commit 1e3e46a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Source/WebKit/android/WebCoreSupport/UrlInterceptResponse.cpp
Expand Up @@ -46,6 +46,7 @@ class JavaInputStreamWrapper {
LOG_ALWAYS_FATAL_IF(!m_read);
m_close = env->GetMethodID(inputStreamClass, "close", "()V");
LOG_ALWAYS_FATAL_IF(!m_close);
env->DeleteLocalRef(inputStreamClass);
}

~JavaInputStreamWrapper() {
Expand Down Expand Up @@ -112,6 +113,7 @@ UrlInterceptResponse::UrlInterceptResponse(JNIEnv* env, jobject response) {
}

env->DeleteLocalRef(javaResponse);
env->DeleteLocalRef(stream);
env->DeleteLocalRef(mimeStr);
env->DeleteLocalRef(encodingStr);
}
Expand Down
4 changes: 3 additions & 1 deletion Source/WebKit/android/jni/WebCoreFrameBridge.cpp
Expand Up @@ -525,7 +525,9 @@ WebFrame::shouldInterceptRequest(const WTF::String& url)
env->DeleteLocalRef(urlStr);
if (response == 0)
return 0;
return new UrlInterceptResponse(env, response);
UrlInterceptResponse* result = new UrlInterceptResponse(env, response);
env->DeleteLocalRef(response);
return result;
}

void
Expand Down

1 comment on commit 1e3e46a

@LOG-TAG
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This "Avoid leaking JNI local references in UrlInterceptResponse" Fix available in latest ICS 4.0.1 or 4.0.2 or 4.0.3 libwebcore.so of latest emulaters ?? please reply
Ref: http://goo.gl/egxED

Please sign in to comment.