(Commands) CommitLastCommand from undoable command crashes

1613729

Dec 17 1996 10:45AM


Calling CommitLastCommand from inside another command's DoIt method will crash if the command can be undone. That's because undoable commands are added to the action history, so the call to CommitLastCommand will free the calling command while it is still in use. And it is really easy to call some code that calls CommitLastCommand without realizing it.Ê
Fix:

No undoable command calls CommitLastCommand inside DoIt method any more.