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

Unified Diff: chrome/browser/profile_impl.cc

Issue 3347018: GTTF: Clean up DownloadFileManager (Closed)
Patch Set: shutdowns Created 10 years, 3 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 | « chrome/browser/profile.cc ('k') | chrome/browser/renderer_host/download_resource_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile_impl.cc
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
index 6a7cb51ed73bd11d27abfe187b8049e5537007fc..6d0f40c2028b1679f3e0c708dd9476b7c2db92e6 100644
--- a/chrome/browser/profile_impl.cc
+++ b/chrome/browser/profile_impl.cc
@@ -463,9 +463,13 @@ ProfileImpl::~ProfileImpl() {
// shut down the database.
template_url_model_.reset();
- // The download manager queries the history system and should be deleted
- // before the history is shutdown so it can properly cancel all requests.
- download_manager_ = NULL;
+ // DownloadManager is lazily created, so check before accessing it.
+ if (download_manager_.get()) {
+ // The download manager queries the history system and should be shutdown
+ // before the history is shutdown so it can properly cancel all requests.
+ download_manager_->Shutdown();
+ download_manager_ = NULL;
+ }
// The theme provider provides bitmaps to whoever wants them.
theme_provider_.reset();
« no previous file with comments | « chrome/browser/profile.cc ('k') | chrome/browser/renderer_host/download_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698