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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 2188593002: aw: Fix edge case with destroy before detach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 65d815924c7e950517e8fcde222ed5a0bdff2aad..6fd8d1fa6d535b9da83ab8d1f7d3bb47fecf0b51 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -1155,11 +1155,10 @@ public class AwContents implements SmartClipProvider,
mPostMessageSender = null;
}
- // If we are attached, we have to call native detach to clean up
- // hardware resources.
if (mIsAttachedToWindow) {
Log.w(TAG, "WebView.destroy() called while WebView is still attached to window.");
- nativeOnDetachedFromWindow(mNativeAwContents);
+ // Need to call detach to avoid leaks because the real detach later will be ignored.
+ onDetachedFromWindow();
}
mIsDestroyed = true;
mHandler.post(new Runnable() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698