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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 1055463002: Add note to ContentViewCore.destroy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: javadoc Created 5 years, 9 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: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index df0b303d607693f341c0dbb642d36be7a17bf401..4ff6459170511ab7465fd783b9a0f322e96ef42b 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -986,6 +986,10 @@ public class ContentViewCore
* called after the ContentView has been removed from the view system. No
* other methods may be called on this ContentView after this method has
* been called.
+ * Warning: destroy() is not guranteed to be called in Android WebView.
+ * Any object that relies solely on destroy() being called to be cleaned up
+ * will leak in Android WebView. If appropriate, consider clean up in
+ * onDetachedFromWindow() which is guaranteed to be called in Android WebView.
*/
public void destroy() {
if (mNativeContentViewCore != 0) {
@@ -1010,6 +1014,8 @@ public class ContentViewCore
ScreenOrientationListener.getInstance().removeObserver(this);
mPositionObserver.clearListener();
mContainerViewObservers.clear();
+
+ // See warning in javadoc before adding more clean up code here.
}
private void unregisterAccessibilityContentObserver() {
« 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