Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,28 @@ public void onResume() {
resumeTimers();
}


/**
* Issue #562: the renderer process leaks when a WebView is dropped
* without an explicit destroy(), and the well-known fix is to
* detach from the parent first so Chromium can release its surface.
* Callers (fragments, activities) should invoke this from their
* own onDestroy() / onDestroyView().
*/
public void release() {
if (jsInterface != null) {
removeJavascriptInterface(HANDLER_NAME_IN_JAVASCRIPT);
jsInterface = null;
}
loadUrl("about:blank");
clearHistory();
ViewGroup parent = (ViewGroup) getParent();
if (parent != null) {
parent.removeView(this);
Comment on lines +134 to +136
}
destroy();
}

/**
* Connects a handler to the JavaScript functions added to HTML for threads, posts, messages etc.
* <p>
Expand Down
Loading