removed winsock_initialized counter as there are no longer two things initializing...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 28 Mar 2003 03:23:13 +0000 (03:23 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 28 Mar 2003 03:23:13 +0000 (03:23 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2863 d7cf8633-e32d-0410-b094-e92efae38249

net_wins.c

index 30d1d41..fea9a91 100644 (file)
@@ -33,7 +33,6 @@ static unsigned long myAddr;
 
 #include "net_wins.h"
 
-int winsock_initialized = 0;
 WSADATA                winsockdata;
 
 //=============================================================================
@@ -101,23 +100,18 @@ int WINS_Init (void)
        if (COM_CheckParm ("-noudp"))
                return -1;
 
-       if (winsock_initialized == 0)
+       r = WSAStartup (MAKEWORD(1, 1), &winsockdata);
+       if (r)
        {
-               r = WSAStartup (MAKEWORD(1, 1), &winsockdata);
-               if (r)
-               {
-                       Con_SafePrintf ("Winsock initialization failed.\n");
-                       return -1;
-               }
+               Con_SafePrintf ("Winsock initialization failed.\n");
+               return -1;
        }
-       winsock_initialized++;
 
        // determine my name
        if (gethostname(buff, MAXHOSTNAMELEN) == SOCKET_ERROR)
        {
                Con_DPrintf ("Winsock TCP/IP Initialization failed.\n");
-               if (--winsock_initialized == 0)
-                       WSACleanup ();
+               WSACleanup ();
                return -1;
        }
 
@@ -164,8 +158,7 @@ int WINS_Init (void)
        if ((net_controlsocket = WINS_OpenSocket (0)) == -1)
        {
                Con_Printf("WINS_Init: Unable to open control socket\n");
-               if (--winsock_initialized == 0)
-                       WSACleanup ();
+               WSACleanup ();
                return -1;
        }
 
@@ -185,8 +178,7 @@ void WINS_Shutdown (void)
 {
        WINS_Listen (false);
        WINS_CloseSocket (net_controlsocket);
-       if (--winsock_initialized == 0)
-               WSACleanup ();
+       WSACleanup ();
 }
 
 //=============================================================================