From d5cca803924422ff8cfc6dadd8ac6b4dd309a68d Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Tue, 28 Jun 2011 18:23:52 +0000 Subject: Http cache: Remove a race between the http cache destructor deleting the pending operations, and the disk cache using data backed by the pending operation. BUG=87396 TEST=none Review URL: http://codereview.chromium.org/7277009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90802 0039d316-1c4b-4281-b951-d872f2087c98 --- net/http/http_cache.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/http/http_cache.cc') diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index fbc6461..cf533e8 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -383,6 +383,10 @@ HttpCache::~HttpCache() { STLDeleteElements(&doomed_entries_); + // Before deleting pending_ops_, we have to make sure that the disk cache is + // done with said operations, or it will attempt to use deleted data. + disk_cache_.reset(); + PendingOpsMap::iterator pending_it = pending_ops_.begin(); for (; pending_it != pending_ops_.end(); ++pending_it) { // We are not notifying the transactions about the cache going away, even -- cgit v1.1