summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-03-08 13:25:00 -0800
committerJohn Reck <jreck@google.com>2012-03-08 13:25:00 -0800
commitd1d87315942218816a509798a299612ed674c21c (patch)
tree3aa90e235da3572416e54fc6eaef12698e109bd5
parent2cc8f6215927157ebdf60a7cc636fe29d2d565b6 (diff)
downloadpackages_apps_browser-d1d87315942218816a509798a299612ed674c21c.zip
packages_apps_browser-d1d87315942218816a509798a299612ed674c21c.tar.gz
packages_apps_browser-d1d87315942218816a509798a299612ed674c21c.tar.bz2
Remove WebSettings from BrowserSettings in destroy
Bug: 5776363 Change-Id: Id142c7096601c2316d71bd9443930080ce92c19c
-rw-r--r--src/com/android/browser/BrowserSettings.java11
-rw-r--r--src/com/android/browser/BrowserWebView.java6
2 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 4f4bb13..4fe93d6 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -161,6 +161,17 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
}
}
+ public void stopManagingSettings(WebSettings settings) {
+ Iterator<WeakReference<WebSettings>> iter = mManagedSettings.iterator();
+ while (iter.hasNext()) {
+ WeakReference<WebSettings> ref = iter.next();
+ if (ref.get() == settings) {
+ iter.remove();
+ return;
+ }
+ }
+ }
+
private Runnable mSetup = new Runnable() {
@Override
diff --git a/src/com/android/browser/BrowserWebView.java b/src/com/android/browser/BrowserWebView.java
index 7981d8a..49d1a2e 100644
--- a/src/com/android/browser/BrowserWebView.java
+++ b/src/com/android/browser/BrowserWebView.java
@@ -124,4 +124,10 @@ public class BrowserWebView extends WebView implements WebViewClassic.TitleBarDe
return false;
}
+ @Override
+ public void destroy() {
+ BrowserSettings.getInstance().stopManagingSettings(getSettings());
+ super.destroy();
+ }
+
}