diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 00:35:36 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 00:35:36 +0000 |
commit | 6f712875d488fd0fd8d7357199879f9f7f962dd3 (patch) | |
tree | c1c776d957d9e4b576ca2882d7cbde962180fc08 /chrome/browser/download | |
parent | 07c3721d718b02000ca00842cf9186ef3614af32 (diff) | |
download | chromium_src-6f712875d488fd0fd8d7357199879f9f7f962dd3.zip chromium_src-6f712875d488fd0fd8d7357199879f9f7f962dd3.tar.gz chromium_src-6f712875d488fd0fd8d7357199879f9f7f962dd3.tar.bz2 |
A crasher would happen if you donwload an exe and the download has completed by the time the download item is created, you have the download tab opened and you press on the discard button.
This is because such downloads gets added to a vector that is used to unregister the DownloadTabView as an observer.
We were deleting the download item before notifying the DownloadTabView, which would cause it to access the deleted download item.
BUG=4134
TEST=Open the download tab, start the download of a short exe. Click the discard button in the dangerous download prompt.
Review URL: http://codereview.chromium.org/9435
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4940 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r-- | chrome/browser/download/download_manager.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc index ed4ebb0..e10173d 100644 --- a/chrome/browser/download/download_manager.cc +++ b/chrome/browser/download/download_manager.cc @@ -954,10 +954,11 @@ void DownloadManager::RemoveDownload(int64 download_handle) { it = dangerous_finished_.find(download->id()); if (it != dangerous_finished_.end()) dangerous_finished_.erase(it); - delete download; // Tell observers to refresh their views. FOR_EACH_OBSERVER(Observer, observers_, ModelChanged()); + + delete download; } int DownloadManager::RemoveDownloadsBetween(const Time remove_begin, |