Release display buffers when a window is added to free list

This commit is contained in:
Maxime Coste 2015-01-26 19:41:10 +00:00
parent 92cb3a035f
commit b697bf1795
2 changed files with 3 additions and 0 deletions

View File

@ -98,6 +98,7 @@ WindowAndSelections ClientManager::get_free_window(Buffer& buffer)
void ClientManager::add_free_window(std::unique_ptr<Window>&& window, SelectionList selections) void ClientManager::add_free_window(std::unique_ptr<Window>&& window, SelectionList selections)
{ {
window->clear_display_buffer();
Buffer& buffer = window->buffer(); Buffer& buffer = window->buffer();
m_free_windows.push_back({ std::move(window), SelectionList{ std::move(selections) }, buffer.timestamp() }); m_free_windows.push_back({ std::move(window), SelectionList{ std::move(selections) }, buffer.timestamp() });
} }

View File

@ -42,6 +42,8 @@ public:
ByteCoord offset_coord(ByteCoord coord, CharCount offset); ByteCoord offset_coord(ByteCoord coord, CharCount offset);
ByteCoordAndTarget offset_coord(ByteCoordAndTarget coord, LineCount offset); ByteCoordAndTarget offset_coord(ByteCoordAndTarget coord, LineCount offset);
void clear_display_buffer() { m_display_buffer = DisplayBuffer{}; }
private: private:
Window(const Window&) = delete; Window(const Window&) = delete;