Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1552)

Unified Diff: chrome/browser/download/download_manager.cc

Issue 7406: Fix a crasher when shutting down with a pending dangerous download (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
===================================================================
--- chrome/browser/download/download_manager.cc (revision 3382)
+++ chrome/browser/download/download_manager.cc (working copy)
@@ -358,9 +358,11 @@
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698