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.
This commit is contained in:
		| @@ -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<Client *>(clients); | ||||
| 	for (Client *client : clients_local) | ||||
| 		callback(client, ctx); | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Denis Krjuchkov
					Denis Krjuchkov