From b697bf1795059800db670452e809df70da30bf75 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 26 Jan 2015 19:41:10 +0000 Subject: [PATCH] Release display buffers when a window is added to free list --- src/client_manager.cc | 1 + src/window.hh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/client_manager.cc b/src/client_manager.cc index 00999113..f1da3159 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -98,6 +98,7 @@ WindowAndSelections ClientManager::get_free_window(Buffer& buffer) void ClientManager::add_free_window(std::unique_ptr&& window, SelectionList selections) { + window->clear_display_buffer(); Buffer& buffer = window->buffer(); m_free_windows.push_back({ std::move(window), SelectionList{ std::move(selections) }, buffer.timestamp() }); } diff --git a/src/window.hh b/src/window.hh index 978fb374..aaeb34a6 100644 --- a/src/window.hh +++ b/src/window.hh @@ -42,6 +42,8 @@ public: ByteCoord offset_coord(ByteCoord coord, CharCount offset); ByteCoordAndTarget offset_coord(ByteCoordAndTarget coord, LineCount offset); + + void clear_display_buffer() { m_display_buffer = DisplayBuffer{}; } private: Window(const Window&) = delete;