From 5d455ec52e025b9322c6fa4cf96ea319cce9bc21 Mon Sep 17 00:00:00 2001 From: "finnur@google.com" Date: Tue, 12 Aug 2008 03:13:44 +0000 Subject: Fix crash due to race condition in ImportingProgressView. What is happening is that the ImporterView creates an ImportingProgressView to show the progress of the import but the ImportingProgressView receives the Cancel event before ImportStarted, so importing_ is not set to true. Cancel will think import is done and returns true (allowing the view to be destroyed) and then the ImporterView will try to communicate with a dead observer. By initializing importing_ to true this crash is avoided (we wouldn't be creating the view unless we were about to import, right?). BUG=1320194 TEST=Open Import dialog, press Enter and then Esc really quickly and Chrome should not crash (try it 10 times to be sure). git-svn-id: svn://svn.chromium.org/chrome/trunk/src@702 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/importing_progress_view.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chrome') diff --git a/chrome/browser/views/importing_progress_view.cc b/chrome/browser/views/importing_progress_view.cc index 60953b3..ec5945d 100644 --- a/chrome/browser/views/importing_progress_view.cc +++ b/chrome/browser/views/importing_progress_view.cc @@ -67,7 +67,7 @@ ImportingProgressView::ImportingProgressView(const std::wstring& source_name, coordinator_(coordinator), import_observer_(observer), items_(items), - importing_(false) { + importing_(true) { coordinator_->SetObserver(this); label_info_->SetMultiLine(true); label_info_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); -- cgit v1.1