Move dropped free windoes to the window trash

This commit is contained in:
Maxime Coste 2019-06-18 21:49:41 +10:00
parent ef6eede888
commit 125b1924ce

View File

@ -155,7 +155,10 @@ WindowAndSelections ClientManager::get_free_window(Buffer& buffer)
void ClientManager::add_free_window(std::unique_ptr<Window>&& window, SelectionList selections)
{
if (not contains(BufferManager::instance(), &window->buffer()))
{
m_window_trash.push_back(std::move(window));
return;
}
window->clear_display_buffer();
m_free_windows.push_back({std::move(window), std::move(selections)});