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

Unified Diff: net/base/winsock_init.cc

Issue 2183253002: Make WinsockInitSingleton explicitly leaky to avoid the AssertSingletonAllowed() dcheck. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: net/base/winsock_init.cc
diff --git a/net/base/winsock_init.cc b/net/base/winsock_init.cc
index e7601859e78ac4ccaceee63cccbb16ec155c0b93..1f488c96c6bf2459e99aa5f008a69fa3985c9c5e 100644
--- a/net/base/winsock_init.cc
+++ b/net/base/winsock_init.cc
@@ -30,15 +30,12 @@ class WinsockInitSingleton {
WSAGetLastError();
}
}
-
- ~WinsockInitSingleton() {
gab 2016/07/27 14:29:17 On the bug when I said "delete the destructor" I m
gab 2016/08/09 16:46:32 ping, I think this would be cleaner, can you do th
- // Don't call WSACleanup() since the worker pool threads can continue to
- // call getaddrinfo() after Winsock has shutdown, which can lead to crashes.
- }
};
-static base::LazyInstance<WinsockInitSingleton> g_winsock_init_singleton =
- LAZY_INSTANCE_INITIALIZER;
+// Worker pool threads that use the Windows Sockets API may still be running at
+// shutdown. Leak instance and skip cleanup.
+static base::LazyInstance<WinsockInitSingleton>::Leaky
+ g_winsock_init_singleton = LAZY_INSTANCE_INITIALIZER;
} // namespace
« 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