diff options
-rw-r--r-- | sway/ipc-server.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index abc2d7cb..01b80b05 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -64,6 +64,10 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { | |||
64 | close(ipc_socket); | 64 | close(ipc_socket); |
65 | unlink(ipc_sockaddr->sun_path); | 65 | unlink(ipc_sockaddr->sun_path); |
66 | 66 | ||
67 | while (ipc_client_list->length) { | ||
68 | struct ipc_client *client = ipc_client_list->items[0]; | ||
69 | ipc_client_disconnect(client); | ||
70 | } | ||
67 | list_free(ipc_client_list); | 71 | list_free(ipc_client_list); |
68 | 72 | ||
69 | if (ipc_sockaddr) { | 73 | if (ipc_sockaddr) { |
@@ -480,6 +484,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
480 | const char *json = cmd_results_to_json(results); | 484 | const char *json = cmd_results_to_json(results); |
481 | char reply[256]; | 485 | char reply[256]; |
482 | int length = snprintf(reply, sizeof(reply), "%s", json); | 486 | int length = snprintf(reply, sizeof(reply), "%s", json); |
487 | free(json); | ||
483 | client_valid = ipc_send_reply(client, reply, (uint32_t)length); | 488 | client_valid = ipc_send_reply(client, reply, (uint32_t)length); |
484 | free_cmd_results(results); | 489 | free_cmd_results(results); |
485 | goto exit_cleanup; | 490 | goto exit_cleanup; |