diff options
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request_http_job.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index 0f65534..32c6ed2 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc @@ -70,8 +70,15 @@ URLRequestHttpJob::~URLRequestHttpJob() { // Prior to reaching the destructor, request_ has been set to a NULL // pointer, so request_->url() is no longer valid in the destructor, and we // use an alternate copy |request_info_.url|. - SdchManager::Global()->FetchDictionary(request_info_.url, - sdch_dictionary_url_); + SdchManager* manager = SdchManager::Global(); + // To be extra safe, since this is a "different time" from when we decided + // to get the dictionary, we'll validate that an SdchManager is available. + // At shutdown time, care is taken to be sure that we don't delete this + // globally useful instance "too soon," so this check is just defensive + // coding to assure that IF the system is shutting down, we don't have any + // problem if the manager was deleted ahead of time. + if (manager) // Defensive programming. + manager->FetchDictionary(request_info_.url, sdch_dictionary_url_); } } |