erratum II

This commit is contained in:
Marc-Éric Martel 2023-10-26 10:47:17 -04:00
parent 8870550512
commit 8e95899192

View File

@ -18,6 +18,9 @@ Server::~Server() {
closesocket(m_sock_udp);
if (m_sock_tcp)
closesocket(m_sock_tcp);
for (const auto& [key, player] : m_players)
closesocket(player->getSock());
m_players.clear();
#ifdef _WIN32
WSACleanup();
#endif
@ -230,6 +233,7 @@ void Server::Log(std::string str, bool is_error = false, bool is_fatal = false)
#ifdef _WIN32
WSACleanup();
#endif
exit(-1);
}
}