clean up resources

This commit is contained in:
Arisotura 2023-09-09 14:13:27 +02:00
parent 6308767a60
commit 091db59827
1 changed files with 15 additions and 1 deletions

View File

@ -295,7 +295,21 @@ bool Init()
void DeInit()
{
// TODO: cleanup resources properly!!
if (DiscoverySocket)
{
closesocket(DiscoverySocket);
DiscoverySocket = INVALID_SOCKET;
}
while (!RXQueue.empty())
{
ENetPacket* packet = RXQueue.front();
RXQueue.pop();
enet_packet_destroy(packet);
}
enet_host_destroy(Host);
Host = nullptr;
enet_deinitialize();
}