fix(editor): undo history causes crash when it overflows
This commit is contained in:
parent
dd5c3a0638
commit
4188e2d9e1
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue