aboutsummaryrefslogtreecommitdiff
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-12-09 21:50:19 +1000
committerGitHub <noreply@github.com>2018-12-09 21:50:19 +1000
commitb61a936c8060bc4ac4320a5f76fd98b5042e5e41 (patch)
tree279a5554686d6e862282c943bda50787b69711e1 /sway/ipc-server.c
parente7efa0e27b7bf44217d7f147281d463708d2dfc9 (diff)
parent98c1e19466c0d83c8e1ca86eda5b273eda7eff3c (diff)
Merge pull request #3271 from ianyfan/list-cleanup
list.c: Remove list_foreach
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r--sway/ipc-server.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index b3954259..2c642a37 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -73,14 +73,11 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
unlink(ipc_sockaddr->sun_path);
while (ipc_client_list->length) {
- struct ipc_client *client = ipc_client_list->items[0];
- ipc_client_disconnect(client);
+ ipc_client_disconnect(ipc_client_list->items[ipc_client_list->length-1]);
}
list_free(ipc_client_list);
- if (ipc_sockaddr) {
- free(ipc_sockaddr);
- }
+ free(ipc_sockaddr);
wl_list_remove(&ipc_display_destroy.link);
}