summaryrefslogtreecommitdiffstats
path: root/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-10-24 11:05:59 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-10-24 11:05:59 +0000
commit3859c9f239eab35789ce7c318120fea728051d40 (patch)
tree374e17a55c7ae3253ca8a6a5fcc5c7152acbda51 /server.c
parentab02144e3d1ed4b3a421e63e5d0464c2cfc239b5 (diff)
Free/close windows properly.
Diffstat (limited to 'server.c')
-rw-r--r--server.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/server.c b/server.c
index 5b24858a..0ee924ca 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.31 2007-10-23 10:25:03 nicm Exp $ */
+/* $Id: server.c,v 1.32 2007-10-24 11:05:59 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -123,6 +123,7 @@ server_main(char *srv_path, int srv_fd)
{
struct pollfd *pfds, *pfd;
int nfds;
+ u_int i;
siginit();
@@ -174,6 +175,18 @@ server_main(char *srv_path, int srv_fd)
server_handle_clients(&pfd);
}
+ for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
+ if (ARRAY_ITEM(&sessions, i) != NULL)
+ session_destroy(ARRAY_ITEM(&sessions, i));
+ }
+ ARRAY_FREE(&sessions);
+
+ for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
+ if (ARRAY_ITEM(&clients, i) != NULL)
+ server_lost_client(ARRAY_ITEM(&clients, i));
+ }
+ ARRAY_FREE(&clients);
+
key_bindings_free();
close(srv_fd);