소스 검색

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.