summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-01-26 19:41:10 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-01-26 19:41:10 +0000
commitb697bf1795059800db670452e809df70da30bf75 (patch)
tree5ac5616396f2ac9e587ac8f25c68543ff902100b /src
parent92cb3a035fb210b8c8da9a7434369741421a18a8 (diff)
Release display buffers when a window is added to free list
Diffstat (limited to 'src')
-rw-r--r--src/client_manager.cc1
-rw-r--r--src/window.hh2
2 files changed, 3 insertions, 0 deletions
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>&& 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;