client: Only unlink if on the idle list
This commit is contained in:
parent
34d0c87ea8
commit
ad214dc3fe
1 changed files with 6 additions and 2 deletions
|
@ -80,8 +80,13 @@ void client_destroy(struct client *client) {
|
||||||
client->connection.fd = -1;
|
client->connection.fd = -1;
|
||||||
}
|
}
|
||||||
if (client->seat != NULL) {
|
if (client->seat != NULL) {
|
||||||
// This should also close and remove all devices
|
// This should also close and remove all devices. This unlinks
|
||||||
|
// the client.
|
||||||
seat_remove_client(client);
|
seat_remove_client(client);
|
||||||
|
} else {
|
||||||
|
// If we are not a member of a seat, we will be on the idle
|
||||||
|
// clients list, so unlink the client manually.
|
||||||
|
linked_list_remove(&client->link);
|
||||||
}
|
}
|
||||||
if (client->event_source != NULL) {
|
if (client->event_source != NULL) {
|
||||||
event_source_fd_destroy(client->event_source);
|
event_source_fd_destroy(client->event_source);
|
||||||
|
@ -89,7 +94,6 @@ void client_destroy(struct client *client) {
|
||||||
}
|
}
|
||||||
connection_close_fds(&client->connection);
|
connection_close_fds(&client->connection);
|
||||||
assert(linked_list_empty(&client->devices));
|
assert(linked_list_empty(&client->devices));
|
||||||
linked_list_remove(&client->link);
|
|
||||||
free(client);
|
free(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue