aboutsummaryrefslogtreecommitdiff
path: root/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'util.cpp')
-rw-r--r--util.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/util.cpp b/util.cpp
index 5efb579bf7..4a5b983d22 100644
--- a/util.cpp
+++ b/util.cpp
@@ -53,6 +53,17 @@ public:
for (int i = 0; i < CRYPTO_num_locks(); i++)
delete ppmutexOpenSSL[i];
OPENSSL_free(ppmutexOpenSSL);
+
+ // Close sockets
+ foreach(CNode* pnode, vNodes)
+ closesocket(pnode->hSocket);
+ if (closesocket(hListenSocket) == SOCKET_ERROR)
+ printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError());
+
+#ifdef __WXMSW__
+ // Shutdown Windows Sockets
+ WSACleanup();
+#endif
}
}
instance_of_cinit;