summaryrefslogtreecommitdiff
path: root/src/client_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/client_manager.cc')
-rw-r--r--src/client_manager.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client_manager.cc b/src/client_manager.cc
index aff88d93..96165538 100644
--- a/src/client_manager.cc
+++ b/src/client_manager.cc
@@ -143,9 +143,18 @@ void ClientManager::ensure_no_client_uses_buffer(Buffer& buffer)
auto end = std::remove_if(m_free_windows.begin(), m_free_windows.end(),
[&buffer](const WindowAndSelections& ws)
{ return &ws.window->buffer() == &buffer; });
+
+ for (auto it = end; it != m_free_windows.end(); ++it)
+ m_window_trash.push_back(std::move(it->window));
+
m_free_windows.erase(end, m_free_windows.end());
}
+void ClientManager::clear_window_trash()
+{
+ m_window_trash.clear();
+}
+
bool ClientManager::validate_client_name(StringView name) const
{
return const_cast<ClientManager*>(this)->get_client_ifp(name) == nullptr;