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

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

Issue 7053004: Fix leak of callback object in r86518. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/download/download_history.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_history.cc
===================================================================
--- chrome/browser/download/download_history.cc (revision 86537)
+++ chrome/browser/download/download_history.cc (working copy)
@@ -24,6 +24,13 @@
}
DownloadHistory::~DownloadHistory() {
+ // For any outstanding requests to HistoryService::GetVisitCountToHost(),
+ // since they'll be cancelled and thus not call back to
+ // OnGotVisitCountToHost(), we need to delete the associated
+ // VisitedBeforeDoneCallbacks.
+ for (VisitedBeforeRequestsMap::iterator i(visited_before_requests_.begin());
+ i != visited_before_requests_.end(); ++i)
+ delete i->second.second;
}
void DownloadHistory::Load(HistoryService::DownloadQueryCallback* callback) {
@@ -56,6 +63,7 @@
}
}
callback->Run(download_id, false);
+ delete callback;
}
void DownloadHistory::AddEntry(
@@ -145,4 +153,5 @@
visited_before_requests_.erase(request);
callback->Run(download_id, found_visits && count &&
(first_visit.LocalMidnight() < base::Time::Now().LocalMidnight()));
+ delete callback;
}
« no previous file with comments | « chrome/browser/download/download_history.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698