From ef1fd3acb95a58900d73a194ce8339b5301dfd0b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 12 Apr 2019 09:02:59 +1000 Subject: Prevent conversion to client on suspend from disconnecting other clients clear the client manager in the to be converted process without sending exit messages as the forked server will still be there. Fixes #2847 --- src/client_manager.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/client_manager.cc') diff --git a/src/client_manager.cc b/src/client_manager.cc index 9dd32df5..ca32678f 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -14,13 +14,18 @@ namespace Kakoune ClientManager::ClientManager() = default; ClientManager::~ClientManager() { - clear(); + clear(true); } -void ClientManager::clear() +void ClientManager::clear(bool disconnect_clients) { - while (not m_clients.empty()) - remove_client(*m_clients.front(), true, 0); + if (disconnect_clients) + { + while (not m_clients.empty()) + remove_client(*m_clients.front(), true, 0); + } + else + m_clients.clear(); m_client_trash.clear(); for (auto& window : m_free_windows) -- cgit v1.2.3