summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-15 17:48:32 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-15 17:48:32 +0000
commite10e17c7b9293c9a49c3dde4149b6113501af33f (patch)
tree5b432df7dea69e858d7bb147af5b35d3a1e20b0f /chrome/browser/download
parent080e893289cf363ae46a49eda5dd4dd533f96222 (diff)
downloadchromium_src-e10e17c7b9293c9a49c3dde4149b6113501af33f.zip
chromium_src-e10e17c7b9293c9a49c3dde4149b6113501af33f.tar.gz
chromium_src-e10e17c7b9293c9a49c3dde4149b6113501af33f.tar.bz2
Fix a crasher when shutting down with a pending dangerous download.
BUG=3457 TEST=See bug Review URL: http://codereview.chromium.org/7406 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_manager.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index cff6935..3519e12 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -358,9 +358,11 @@ void DownloadManager::Shutdown() {
for (std::set<DownloadItem*>::const_iterator rm_it = to_remove.begin();
rm_it != to_remove.end(); ++rm_it) {
DownloadItem* download = *rm_it;
+ int64 handle = download->db_handle();
download->Remove(true);
- // Same as above, delete the download if it is not in 'downloads_'.
- if (download->db_handle() == kUninitializedHandle)
+ // Same as above, delete the download if it is not in 'downloads_' (as the
+ // Remove() call above won't have deleted it).
+ if (handle == kUninitializedHandle)
delete download;
}
to_remove.clear();