diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-19 01:35:05 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-19 01:35:05 +0000 |
commit | 32322da8387c80e3158f7045ffa9fe69830ffe86 (patch) | |
tree | 82ff7d3bbb51d28df22f4c266dfc7a3b30d46d01 /chrome | |
parent | 0d525036512529fc73287726ac65649040672f86 (diff) | |
download | chromium_src-32322da8387c80e3158f7045ffa9fe69830ffe86.zip chromium_src-32322da8387c80e3158f7045ffa9fe69830ffe86.tar.gz chromium_src-32322da8387c80e3158f7045ffa9fe69830ffe86.tar.bz2 |
In the password option pages, a table is used.
On deletion, the model goes away before the actual table,
causing the table to access a deleted object.
This CL fixes it.
BUG=30791
TEST=Bring up the password dialog (in the options dialog, 'Personal Stuff', 'Show saved passwords').
Review URL: http://codereview.chromium.org/503063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
4 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/views/options/exceptions_page_view.cc b/chrome/browser/views/options/exceptions_page_view.cc index 7d60f5e..a0dd49c 100644 --- a/chrome/browser/views/options/exceptions_page_view.cc +++ b/chrome/browser/views/options/exceptions_page_view.cc @@ -80,6 +80,12 @@ ExceptionsPageView::ExceptionsPageView(Profile* profile) table_view_(NULL) { } +ExceptionsPageView::~ExceptionsPageView() { + // The model is going away, prevent the table from accessing it. + if (table_view_) + table_view_->SetModel(NULL); +} + void ExceptionsPageView::OnSelectionChanged() { bool has_selection = table_view_->SelectedRowCount() > 0; remove_button_.SetEnabled(has_selection); diff --git a/chrome/browser/views/options/exceptions_page_view.h b/chrome/browser/views/options/exceptions_page_view.h index b603a35..10756d9 100644 --- a/chrome/browser/views/options/exceptions_page_view.h +++ b/chrome/browser/views/options/exceptions_page_view.h @@ -39,6 +39,7 @@ class ExceptionsPageView : public OptionsPageView, public PasswordsTableModelObserver { public: explicit ExceptionsPageView(Profile* profile); + virtual ~ExceptionsPageView(); // views::TableViewObserverImplementation. virtual void OnSelectionChanged(); diff --git a/chrome/browser/views/options/passwords_page_view.cc b/chrome/browser/views/options/passwords_page_view.cc index a8179c2..da047f6 100644 --- a/chrome/browser/views/options/passwords_page_view.cc +++ b/chrome/browser/views/options/passwords_page_view.cc @@ -188,6 +188,12 @@ PasswordsPageView::PasswordsPageView(Profile* profile) current_selected_password_(NULL) { } +PasswordsPageView::~PasswordsPageView() { + // The model is going away, prevent the table from accessing it. + if (table_view_) + table_view_->SetModel(NULL); +} + void PasswordsPageView::OnSelectionChanged() { bool has_selection = table_view_->SelectedRowCount() > 0; remove_button_.SetEnabled(has_selection); diff --git a/chrome/browser/views/options/passwords_page_view.h b/chrome/browser/views/options/passwords_page_view.h index eeb752a..7d196ff 100644 --- a/chrome/browser/views/options/passwords_page_view.h +++ b/chrome/browser/views/options/passwords_page_view.h @@ -149,6 +149,7 @@ class PasswordsPageView : public OptionsPageView, public ConfirmMessageBoxObserver { public: explicit PasswordsPageView(Profile* profile); + virtual ~PasswordsPageView(); // views::TableViewObserverImplementation. virtual void OnSelectionChanged(); |