From f53dadcc6d0a29ce7419a07a51762b4b44654696 Mon Sep 17 00:00:00 2001 From: Denis Krjuchkov Date: Sun, 13 Jan 2013 15:36:25 +0600 Subject: [PATCH] ClientList.cxx: copy client list before iterating It seems that it is not safe to remove the item from std::list while it's being iterated somewhere else. This is a very simple quick fix to make things work until some better solution is implemented. --- src/ClientList.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ClientList.cxx b/src/ClientList.cxx index b45be34c3..403da3a18 100644 --- a/src/ClientList.cxx +++ b/src/ClientList.cxx @@ -59,7 +59,8 @@ client_list_add(Client *client) void client_list_foreach(void (*callback)(Client *client, void *ctx), void *ctx) { - for (Client *client : clients) + auto clients_local = std::list(clients); + for (Client *client : clients_local) callback(client, ctx); }