From f732ea4efb13ced7055a7cc82d30c6cff0a558d3 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 8 Apr 2019 22:32:30 +1000 Subject: [PATCH] Refactor ClientManager::clear --- src/client_manager.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client_manager.cc b/src/client_manager.cc index 9ca5f555..9dd32df5 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -19,11 +19,10 @@ ClientManager::~ClientManager() void ClientManager::clear() { - // So that clients destructor find the client manager empty - // so that local UI does not fork. - ClientList clients = std::move(m_clients); - clients.clear(); + while (not m_clients.empty()) + remove_client(*m_clients.front(), true, 0); m_client_trash.clear(); + for (auto& window : m_free_windows) window.window->run_hook_in_own_context(Hook::WinClose, window.window->buffer().name());