Move list removal to seat/client destroy
This commit is contained in:
parent
5b8117f3d4
commit
5d4036e9bd
3 changed files with 2 additions and 2 deletions
|
@ -89,6 +89,7 @@ void client_destroy(struct client *client) {
|
|||
}
|
||||
connection_close_fds(&client->connection);
|
||||
assert(linked_list_empty(&client->devices));
|
||||
linked_list_remove(&client->link);
|
||||
free(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ void seat_destroy(struct seat *seat) {
|
|||
}
|
||||
assert(seat->curttyfd == -1);
|
||||
|
||||
linked_list_remove(&seat->link);
|
||||
free(seat->seat_name);
|
||||
free(seat);
|
||||
}
|
||||
|
|
|
@ -54,12 +54,10 @@ void server_finish(struct server *server) {
|
|||
assert(server);
|
||||
while (!linked_list_empty(&server->idle_clients)) {
|
||||
struct client *client = (struct client *)server->idle_clients.next;
|
||||
linked_list_remove(&client->link);
|
||||
client_destroy(client);
|
||||
}
|
||||
while (!linked_list_empty(&server->seats)) {
|
||||
struct seat *seat = (struct seat *)server->seats.next;
|
||||
linked_list_remove(&seat->link);
|
||||
seat_destroy(seat);
|
||||
}
|
||||
poller_finish(&server->poller);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue