ClientList: allow deleting clients in client_list_foreach() callback

This commit is contained in:
Dark Raven 2013-01-14 11:24:54 +01:00 committed by Max Kellermann
parent aa4c506fcd
commit f56c6a18c1
1 changed files with 2 additions and 2 deletions

View File

@ -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