diff options
author | Dark Raven <drdarkraven@gmail.com> | 2013-01-14 11:24:54 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-14 11:24:54 +0100 |
commit | f56c6a18c13f4135fa9944cb7cb568115a018955 (patch) | |
tree | 86c0cca37b549c60a91cde07b3773bba8a6cbc3c /src/ClientList.cxx | |
parent | aa4c506fcd63cd20fee48d07fae02e84a1f73704 (diff) | |
download | mpd-f56c6a18c13f4135fa9944cb7cb568115a018955.tar.gz mpd-f56c6a18c13f4135fa9944cb7cb568115a018955.tar.xz mpd-f56c6a18c13f4135fa9944cb7cb568115a018955.zip |
ClientList: allow deleting clients in client_list_foreach() callback
Diffstat (limited to 'src/ClientList.cxx')
-rw-r--r-- | src/ClientList.cxx | 4 |
1 files 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 |