From 6057616e00a6792e219fab2ce958306e737faa67 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 11 Dec 2022 13:14:57 +0200 Subject: [PATCH] Don't create the WinSock helper until the first socket is created --- source/net/windows/socket.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/net/windows/socket.cpp b/source/net/windows/socket.cpp index 07db95d..eadc22a 100644 --- a/source/net/windows/socket.cpp +++ b/source/net/windows/socket.cpp @@ -27,7 +27,7 @@ public: } }; -WinSockHelper wsh; +unique_ptr wsh; } @@ -37,6 +37,8 @@ namespace Net { void Socket::platform_init() { + if(!wsh) + wsh = make_unique(); *priv->event = CreateEvent(0, false, false, 0); } -- 2.45.2