From 3f79fd8c6a86f2376e9f3a2485f81ebd5c37bb82 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 15 Apr 2010 15:00:47 +0200 Subject: [PATCH] Simplify session_remove_clients --- src/session.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/session.c b/src/session.c index c0f9c16..676627c 100644 --- a/src/session.c +++ b/src/session.c @@ -451,15 +451,8 @@ static void select_targets_callback(void *context, struct session_database *db) static void session_remove_clients(struct session *se) { - struct client *cl = se->clients; - while (cl) - { - struct client *cl_next = client_next_in_session(cl); - client_remove_from_session(cl); - client_destroy(cl); - cl = cl_next; - } - se->clients = 0; + while (se->clients) + client_remove_from_session(se->clients); } // Associates a set of clients with a session; -- 1.7.10.4