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

Unified Diff: chrome/browser/search_engines/template_url_service.cc

Issue 14081007: Fix memory leaks in tests caused by not tearing down TemplateUrlService correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Call Shutdown from dtor if not already called Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url_service.cc
diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc
index 1472068b6f181512631b0849a9738a4f8038c19c..63cf81f88fab78243cfafb62aa7726cdc7867772 100644
--- a/chrome/browser/search_engines/template_url_service.cc
+++ b/chrome/browser/search_engines/template_url_service.cc
@@ -306,6 +306,9 @@ TemplateURLService::TemplateURLService(const Initializer* initializers,
}
TemplateURLService::~TemplateURLService() {
+ if (service_)
+ Shutdown();
+ STLDeleteElements(&template_urls_);
}
// static
@@ -881,7 +884,6 @@ void TemplateURLService::Shutdown() {
service_->CancelRequest(load_handle_);
}
service_ = NULL;
- STLDeleteElements(&template_urls_);
}
void TemplateURLService::OnSyncedDefaultSearchProviderGUIDChanged() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698