summaryrefslogtreecommitdiff
path: root/src/buffer.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-08-04 11:39:28 +0700
committerMaxime Coste <mawww@kakoune.org>2017-08-04 11:39:28 +0700
commitfc64369f9d8d3279f73b89fdd76df2fa1468ff72 (patch)
tree1efec616364f72c6ca00cc7ec754cb8f6aa49efb /src/buffer.hh
parent45a7496f545bf7b10940bc55c27ddf018a1ffd17 (diff)
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
Diffstat (limited to 'src/buffer.hh')
-rw-r--r--src/buffer.hh4
1 files changed, 2 insertions, 2 deletions
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<Modification, MemoryDomain::BufferMeta>;
- struct HistoryNode : SafeCountable, UseMemoryDomain<MemoryDomain::BufferMeta>
+ struct HistoryNode : SafeCountable, UseMemoryDomain<MemoryDomain::BufferMeta>
{
HistoryNode(size_t id, HistoryNode* parent);
UndoGroup undo_group;
Vector<std::unique_ptr<HistoryNode>, MemoryDomain::BufferMeta> childs;
SafePtr<HistoryNode> parent;
- SafePtr<HistoryNode> redo_child;
+ HistoryNode* redo_child = nullptr; // not a SafePtr to avoid lifetime issues between this and childs
size_t id;
TimePoint timepoint;
};