undo icon indicating copy to clipboard operation
undo copied to clipboard

Assertion triggered

Open Riztazz opened this issue 2 years ago • 0 comments

Hi,

I've been tinkering a bit with your library in past few days and when trying to limit the history size i keep running into assertion crash at line: https://github.com/dacap/undo/blob/main/undo_history.cpp#L133

I've basically added this at the end of https://github.com/dacap/undo/blob/main/undo_history.cpp#L157:

if ( ++m_addedCommands > 10 )
{
    deleteFirstState();
   --m_addedCommands;
}

and then execute a bunch of commands, go backwards, execute commands, go forward, execute commands - after a few front pops it will assert and crash

Riztazz avatar Jan 28 '23 07:01 Riztazz