summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 01:00:17 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 01:00:17 +0000
commit1e744f200179976645ef75859569eaa475b820be (patch)
tree650866f172a233cdf717eae464e0256c5233d746 /chrome/browser/profile.cc
parent811b9e92113795df7fd2315bedfa114a8a83192a (diff)
downloadchromium_src-1e744f200179976645ef75859569eaa475b820be.zip
chromium_src-1e744f200179976645ef75859569eaa475b820be.tar.gz
chromium_src-1e744f200179976645ef75859569eaa475b820be.tar.bz2
hclam: picked you for this review based on the revision log of ChromeURLRequestContext, but feel free to redirect if there is someone better.
Fix leak of media_request_context_. This is kind of a nasty fix though. I think that ChromeURLRequestContext needs to be refactored more, but not sure exactly how right now. If you don't like this fix, I won't feel bad nuking it and letting someone working on this area handle it. Review URL: http://codereview.chromium.org/63073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r--chrome/browser/profile.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index a290fa0..5f6bb1e 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -482,6 +482,16 @@ ProfileImpl::~ProfileImpl() {
request_context_ = NULL;
}
+ if (media_request_context_) {
+ media_request_context_->CleanupOnUIThread();
+
+ // Clean up request context on IO thread.
+ g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
+ NewRunnableMethod(media_request_context_,
+ &base::RefCountedThreadSafe<URLRequestContext>::Release));
+ media_request_context_ = NULL;
+ }
+
// HistoryService may call into the BookmarkModel, as such we need to
// delete HistoryService before the BookmarkModel. The destructor for
// HistoryService will join with HistoryService's backend thread so that