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

Unified Diff: chrome/browser/io_thread.cc

Issue 1562593002: Fix potential crashes in NetworkHandler code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test
Patch Set: Created 4 years, 11 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
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index cc7872f5efc962fa7e2d6533fe823dad312db444..e9aca8b10ae5a72d0507754e9dbf440e80a54a78 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -556,8 +556,7 @@ IOThread::~IOThread() {
// This isn't needed for production code, but in tests, IOThread may
// be multiply constructed.
BrowserThread::SetDelegate(BrowserThread::IO, NULL);
-
- pref_proxy_config_tracker_->DetachFromPrefService();
+ ShutdownPrefProxyConfigTracker();
DCHECK(!globals_);
}
@@ -893,6 +892,13 @@ void IOThread::Init() {
weak_factory_.GetWeakPtr()));
}
+void IOThread::ShutdownPrefProxyConfigTracker() {
+ if (!pref_proxy_config_tracker_)
+ return;
+ pref_proxy_config_tracker_->DetachFromPrefService();
+ pref_proxy_config_tracker_.reset();
+}
+
void IOThread::CleanUp() {
base::debug::LeakTracker<SafeBrowsingURLRequestContext>::CheckForLeaks();

Powered by Google App Engine
This is Rietveld 408576698