From fc64369f9d8d3279f73b89fdd76df2fa1468ff72 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 4 Aug 2017 11:39:28 +0700 Subject: Purge history on buffer reload when NoUndo flag is on We were preserving the history in that case, so on fifo buffers (that set the NoUndo flag until the fifo is closed), we still had the history from the "previous life" of the buffer, leading crashes when trying to apply it. Fixes #1518 --- src/buffer.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/buffer.hh') diff --git a/src/buffer.hh b/src/buffer.hh index ee03c0a0..7cf2db7b 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -252,14 +252,14 @@ private: using UndoGroup = Vector; - struct HistoryNode : SafeCountable, UseMemoryDomain + struct HistoryNode : SafeCountable, UseMemoryDomain { HistoryNode(size_t id, HistoryNode* parent); UndoGroup undo_group; Vector, MemoryDomain::BufferMeta> childs; SafePtr parent; - SafePtr redo_child; + HistoryNode* redo_child = nullptr; // not a SafePtr to avoid lifetime issues between this and childs size_t id; TimePoint timepoint; }; -- cgit v1.2.3