]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/windows/socket.cpp
Don't create the WinSock helper until the first socket is created
[libs/net.git] / source / net / windows / socket.cpp
index 07db95d1f7dd928ab357d645754a05d4b899a6b4..eadc22af3a2de5355c349d16e201f8d1ec01b032 100644 (file)
@@ -27,7 +27,7 @@ public:
        }
 };
 
-WinSockHelper wsh;
+unique_ptr<WinSockHelper> wsh;
 
 }
 
@@ -37,6 +37,8 @@ namespace Net {
 
 void Socket::platform_init()
 {
+       if(!wsh)
+               wsh = make_unique<WinSockHelper>();
        *priv->event = CreateEvent(0, false, false, 0);
 }