mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-10 21:55:11 +01:00
Small bug fix, close socket
This commit is contained in:
parent
978f0ce537
commit
1fc28d9bbf
@ -614,7 +614,7 @@ void NetworkServer::RemoveClient(NetworkClient *client)
|
||||
/* Swap with last */
|
||||
this->clients[i] = this->clients[this->n_clients - 1];
|
||||
}
|
||||
delete this->clients[i];
|
||||
delete client;
|
||||
this->n_clients--;
|
||||
return;
|
||||
}
|
||||
@ -636,6 +636,7 @@ NetworkClient::NetworkClient(int sock) : Network()
|
||||
NetworkClient::~NetworkClient()
|
||||
{
|
||||
free(this->screen);
|
||||
this->CloseSocket(this->sock);
|
||||
}
|
||||
|
||||
void NetworkClient::Disconnect()
|
||||
|
@ -67,6 +67,8 @@ public:
|
||||
this->bytes_sent = 0;
|
||||
}
|
||||
|
||||
void CloseSocket(int sock);
|
||||
|
||||
bool SendUpdate(int sock);
|
||||
|
||||
bool ReceiveUpdate(int sock);
|
||||
|
@ -200,3 +200,8 @@ bool Network::Select(int sock, struct timeval *tv)
|
||||
/* v is 0 if the sock is not ready */
|
||||
return v > 0;
|
||||
}
|
||||
|
||||
void Network::CloseSocket(int sock)
|
||||
{
|
||||
close(sock);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user