client: Do not leak idle clients on exit

This commit is contained in:
Kenny Levinsen 2020-08-31 22:44:02 +02:00
parent c9ce7c71aa
commit 5b8117f3d4
4 changed files with 11 additions and 1 deletions

View file

@ -138,6 +138,7 @@ static int handle_open_seat(struct client *client) {
return -1;
}
linked_list_remove(&client->link);
if (seat_add_client(seat, client) == -1) {
log_errorf("unable to add client to target seat: %s", strerror(errno));
return -1;
@ -174,6 +175,7 @@ static int handle_close_seat(struct client *client) {
log_error("unable to remove client from seat");
return -1;
}
linked_list_insert(&client->server->idle_clients, &client->link);
struct proto_header header = {
.opcode = SERVER_SEAT_CLOSED,