From 4188e2d9e1a372e6795ca446548eb311c88288b3 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Mon, 30 Jun 2025 21:59:15 +0200 Subject: [PATCH] fix(editor): undo history causes crash when it overflows --- editor/undohistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/undohistory.cpp b/editor/undohistory.cpp index d57e43b..03533a5 100644 --- a/editor/undohistory.cpp +++ b/editor/undohistory.cpp @@ -7,7 +7,7 @@ void UndoHistory::PushState(UndoState state) { redoHistory = {}; if (maxBufferSize != -1 && (int)undoHistory.size() > maxBufferSize) - undoHistory.erase(undoHistory.begin(), undoHistory.begin()+maxBufferSize-(int)undoHistory.size()-1); + undoHistory.pop_front(); undoHistory.push_back(state); undoStateListener();