From f56c6a18c13f4135fa9944cb7cb568115a018955 Mon Sep 17 00:00:00 2001 From: Dark Raven Date: Mon, 14 Jan 2013 11:24:54 +0100 Subject: [PATCH] ClientList: allow deleting clients in client_list_foreach() callback --- src/ClientList.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ClientList.cxx b/src/ClientList.cxx index b45be34c3..a1248c8ec 100644 --- a/src/ClientList.cxx +++ b/src/ClientList.cxx @@ -59,8 +59,8 @@ client_list_add(Client *client) void client_list_foreach(void (*callback)(Client *client, void *ctx), void *ctx) { - for (Client *client : clients) - callback(client, ctx); + for (auto client = clients.begin(); client != clients.end();) + callback(*(client++), ctx); } void