| 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();
|
|
|