diff options
| author | John Reck <jreck@android.com> | 2012-08-30 11:43:34 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-08-30 11:43:34 -0700 |
| commit | 8f58dfa975d01c5c50de513848a6aa8a4460d32c (patch) | |
| tree | ecca62a62579412d2b24bda0fbccc316d42937b0 | |
| parent | 044a9b97b01a934e6cd9ef2f2914d401c4fa145b (diff) | |
| parent | da5cd308028f8f6863bbe3631de91b96802695ec (diff) | |
| download | frameworks_base-8f58dfa975d01c5c50de513848a6aa8a4460d32c.zip frameworks_base-8f58dfa975d01c5c50de513848a6aa8a4460d32c.tar.gz frameworks_base-8f58dfa975d01c5c50de513848a6aa8a4460d32c.tar.bz2 | |
am da5cd308: am ae03afda: Merge "onSavePassword dialog can leak when WebViewClassic is destroyed."
* commit 'da5cd308028f8f6863bbe3631de91b96802695ec':
onSavePassword dialog can leak when WebViewClassic is destroyed.
| -rw-r--r-- | core/java/android/webkit/WebViewClassic.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java index 84a6129..34c08ef 100644 --- a/core/java/android/webkit/WebViewClassic.java +++ b/core/java/android/webkit/WebViewClassic.java @@ -686,6 +686,10 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc // It's used to dismiss the dialog in destroy if not done before. private AlertDialog mListBoxDialog = null; + // Reference to the save password dialog so it can be dimissed in + // destroy if not done before. + private AlertDialog mSavePasswordDialog = null; + static final String LOGTAG = "webview"; private ZoomManager mZoomManager; @@ -1811,7 +1815,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc neverRemember.getData().putString("password", password); neverRemember.obj = resumeMsg; - new AlertDialog.Builder(mContext) + mSavePasswordDialog = new AlertDialog.Builder(mContext) .setTitle(com.android.internal.R.string.save_password_label) .setMessage(com.android.internal.R.string.save_password_message) .setPositiveButton(com.android.internal.R.string.save_password_notnow, @@ -1822,6 +1826,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc resumeMsg.sendToTarget(); mResumeMsg = null; } + mSavePasswordDialog = null; } }) .setNeutralButton(com.android.internal.R.string.save_password_remember, @@ -1832,6 +1837,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc remember.sendToTarget(); mResumeMsg = null; } + mSavePasswordDialog = null; } }) .setNegativeButton(com.android.internal.R.string.save_password_never, @@ -1842,6 +1848,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc neverRemember.sendToTarget(); mResumeMsg = null; } + mSavePasswordDialog = null; } }) .setOnCancelListener(new OnCancelListener() { @@ -1851,6 +1858,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc resumeMsg.sendToTarget(); mResumeMsg = null; } + mSavePasswordDialog = null; } }).show(); // Return true so that WebViewCore will pause while the dialog is @@ -2090,6 +2098,10 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc mListBoxDialog.dismiss(); mListBoxDialog = null; } + if (mSavePasswordDialog != null) { + mSavePasswordDialog.dismiss(); + mSavePasswordDialog = null; + } if (mWebViewCore != null) { // Tell WebViewCore to destroy itself synchronized (this) { |
