From: Mikko Rasa Date: Sun, 11 Dec 2022 11:14:57 +0000 (+0200) Subject: Don't create the WinSock helper until the first socket is created X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6057616e00a6792e219fab2ce958306e737faa67;p=libs%2Fnet.git Don't create the WinSock helper until the first socket is created --- 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); }