Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: android_webview/native/aw_contents.cc

Issue 24228003: Upstream ShouldOverrideUrlLoading changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a forgotten merge reject Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index a8a81e9e9989f69d7d544986c6408a403e5d7f5b..b6b58f6a0cee3705ff0167db4cb702263c6df91d 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -306,8 +306,11 @@ jint AwContents::GetWebContents(JNIEnv* env, jobject obj) {
}
void AwContents::Destroy(JNIEnv* env, jobject obj) {
- delete this;
-
+ java_ref_.reset();
+ // We do not delete AwContents immediately. Some applications try to delete
+ // Webview in ShouldOverrideUrlLoading callback, which is a sync IPC from
+ // Webkit.
+ BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, this);
// When the last WebView is destroyed free all discardable memory allocated by
// Chromium, because the app process may continue to run for a long time
// without ever using another WebView.

Powered by Google App Engine
This is Rietveld 408576698