Index: android_webview/native/aw_contents.cc |
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc |
index f90241875cf5bd240fdedcf313a363ae0943cbab..6be0974420ccb9773a0b7fb20eb3e304448e602d 100644 |
--- a/android_webview/native/aw_contents.cc |
+++ b/android_webview/native/aw_contents.cc |
@@ -300,6 +300,10 @@ void AwContents::Destroy(JNIEnv* env, jobject obj) { |
AwContentsClientBridgeBase::Disassociate(web_contents_.get()); |
contents_client_bridge_.reset(); |
+ // Do not wait until the WebContents are deleted asynchronously to clear |
+ // the delegate and stop sending callbacks. |
+ web_contents_->SetDelegate(NULL); |
+ |
// We do not delete AwContents immediately. Some applications try to delete |
// Webview in ShouldOverrideUrlLoading callback, which is a sync IPC from |
// Webkit. |