diff options
author | aarya@google.com <aarya@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-27 06:12:51 +0000 |
---|---|---|
committer | aarya@google.com <aarya@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-27 06:12:51 +0000 |
commit | 2a55e6895b67e06eddafc0b90cb6750a8b64f94b (patch) | |
tree | 3cb24dbe915aa86c7559144ed105de5f1728c0ce /chrome | |
parent | f5611f95bf53c9c3aaf0e793f7d79b09c80f62fc (diff) | |
download | chromium_src-2a55e6895b67e06eddafc0b90cb6750a8b64f94b.zip chromium_src-2a55e6895b67e06eddafc0b90cb6750a8b64f94b.tar.gz chromium_src-2a55e6895b67e06eddafc0b90cb6750a8b64f94b.tar.bz2 |
Before object destruction, make sure that its select dialogs are told that we
are gone so that they don't try and call back to us. This bug was reproducible
on extensions, but similar occurences were found in code auditing.
BUG=77349
TEST=None
Review URL: http://codereview.chromium.org/6747007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
6 files changed, 31 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_bookmarks_module.cc b/chrome/browser/extensions/extension_bookmarks_module.cc index 38b7422d..eea4ff1 100644 --- a/chrome/browser/extensions/extension_bookmarks_module.cc +++ b/chrome/browser/extensions/extension_bookmarks_module.cc @@ -800,7 +800,12 @@ void CreateBookmarkFunction::GetQuotaLimitHeuristics( BookmarksIOFunction::BookmarksIOFunction() {} -BookmarksIOFunction::~BookmarksIOFunction() {} +BookmarksIOFunction::~BookmarksIOFunction() { + // There may be pending file dialogs, we need to tell them that we've gone + // away so they don't try and call back to us. + if (select_file_dialog_.get()) + select_file_dialog_->ListenerDestroyed(); +} void BookmarksIOFunction::SelectFile(SelectFileDialog::Type type) { // Balanced in one of the three callbacks of SelectFileDialog: diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc index 8bdbdc4..429f715 100644 --- a/chrome/browser/extensions/extensions_ui.cc +++ b/chrome/browser/extensions/extensions_ui.cc @@ -849,6 +849,11 @@ void ExtensionsDOMHandler::GetActivePagesForExtensionProcess( } ExtensionsDOMHandler::~ExtensionsDOMHandler() { + // There may be pending file dialogs, we need to tell them that we've gone + // away so they don't try and call back to us. + if (load_extension_dialog_.get()) + load_extension_dialog_->ListenerDestroyed(); + if (pack_job_.get()) pack_job_->ClearClient(); diff --git a/chrome/browser/ui/gtk/certificate_dialogs.cc b/chrome/browser/ui/gtk/certificate_dialogs.cc index d3151c7..7866b287 100644 --- a/chrome/browser/ui/gtk/certificate_dialogs.cc +++ b/chrome/browser/ui/gtk/certificate_dialogs.cc @@ -107,6 +107,11 @@ Exporter::Exporter(gfx::NativeWindow parent, } Exporter::~Exporter() { + // There may be pending file dialogs, we need to tell them that we've gone + // away so they don't try and call back to us. + if (select_file_dialog_.get()) + select_file_dialog_->ListenerDestroyed(); + x509_certificate_model::DestroyCertChain(&cert_chain_list_); } diff --git a/chrome/browser/ui/webui/options/advanced_options_handler.cc b/chrome/browser/ui/webui/options/advanced_options_handler.cc index ae43ced..a3a1779 100644 --- a/chrome/browser/ui/webui/options/advanced_options_handler.cc +++ b/chrome/browser/ui/webui/options/advanced_options_handler.cc @@ -59,6 +59,10 @@ AdvancedOptionsHandler::AdvancedOptionsHandler() { } AdvancedOptionsHandler::~AdvancedOptionsHandler() { + // There may be pending file dialogs, we need to tell them that we've gone + // away so they don't try and call back to us. + if (select_folder_dialog_.get()) + select_folder_dialog_->ListenerDestroyed(); } void AdvancedOptionsHandler::GetLocalizedValues( diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc index 67397a2..6dc2b4b 100644 --- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc +++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc @@ -681,8 +681,13 @@ void CertificateManagerHandler::ImportExportCleanup() { password_.clear(); file_data_.clear(); selected_cert_list_.clear(); - select_file_dialog_ = NULL; module_ = NULL; + + // There may be pending file dialogs, we need to tell them that we've gone + // away so they don't try and call back to us. + if (select_file_dialog_.get()) + select_file_dialog_->ListenerDestroyed(); + select_file_dialog_ = NULL; } void CertificateManagerHandler::ImportServer(const ListValue* args) { diff --git a/chrome/browser/ui/webui/options/extension_settings_handler.cc b/chrome/browser/ui/webui/options/extension_settings_handler.cc index 9c1557b..b575d97 100644 --- a/chrome/browser/ui/webui/options/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/options/extension_settings_handler.cc @@ -957,6 +957,11 @@ void ExtensionsDOMHandler::GetActivePagesForExtensionProcess( } ExtensionsDOMHandler::~ExtensionsDOMHandler() { + // There may be pending file dialogs, we need to tell them that we've gone + // away so they don't try and call back to us. + if (load_extension_dialog_.get()) + load_extension_dialog_->ListenerDestroyed(); + if (pack_job_.get()) pack_job_->ClearClient(); |