mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
ipc-server: free clients at destroy
This commit is contained in:
parent
9f5d539657
commit
ffe9de6e24
1 changed files with 5 additions and 0 deletions
|
@ -64,6 +64,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
|||
close(ipc_socket);
|
||||
unlink(ipc_sockaddr->sun_path);
|
||||
|
||||
while (ipc_client_list->length) {
|
||||
struct ipc_client *client = ipc_client_list->items[0];
|
||||
ipc_client_disconnect(client);
|
||||
}
|
||||
list_free(ipc_client_list);
|
||||
|
||||
if (ipc_sockaddr) {
|
||||
|
@ -480,6 +484,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
|
|||
const char *json = cmd_results_to_json(results);
|
||||
char reply[256];
|
||||
int length = snprintf(reply, sizeof(reply), "%s", json);
|
||||
free(json);
|
||||
client_valid = ipc_send_reply(client, reply, (uint32_t)length);
|
||||
free_cmd_results(results);
|
||||
goto exit_cleanup;
|
||||
|
|
Loading…
Reference in a new issue