From a95d51e28cc26786894cf776cf1d693f6d921fff Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 19 Oct 2020 17:00:25 +0100 Subject: [PATCH] Deliberately 'leak' winsock to avoid deadlock on shutdown. Closes #2079 --- renderdoc/os/win32/win32_network.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/renderdoc/os/win32/win32_network.cpp b/renderdoc/os/win32/win32_network.cpp index e67a7a921..490e76ccb 100644 --- a/renderdoc/os/win32/win32_network.cpp +++ b/renderdoc/os/win32/win32_network.cpp @@ -109,7 +109,10 @@ void Init() void Shutdown() { - WSACleanup(); + // we'd normally call WSACleanup() here but we can't - like many functions we call anyway it's not + // safe to call in DllMain when shutting down. Unlike other functions, it has minimal impact to + // just skip the call and 'leak' winsock since we're shutting down the process anyway. + // WSACleanup(); } Socket::~Socket()