Simplify session_remove_clients
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 15 Apr 2010 13:00:47 +0000 (15:00 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 15 Apr 2010 13:00:47 +0000 (15:00 +0200)
src/session.c

index c0f9c16..676627c 100644 (file)
@@ -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;