浏览代码

Implemented correct windows socket cleanup

Resolves HerculesWS/Hercules#1513
Thanks to @mkbu95 for bringing this up
Lemongrass3110 8 年之前
父节点
当前提交
b5de7df013
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/common/socket.c

+ 7 - 0
src/common/socket.c

@@ -1218,6 +1218,13 @@ void socket_final(void)
 	aFree(session[0]->session_data);
 	aFree(session[0]);
 	session[0] = NULL;
+
+#ifdef WIN32
+	// Shut down windows networking
+	if( WSACleanup() != 0 ){
+		ShowError("socket_final: WinSock could not be cleaned up! %s\n", error_msg() );
+	}
+#endif
 }
 
 /// Closes a socket.