Bugfix: Crash with crop tool
The reason for crash was use after free, and the flow is like this:
- User Crops the image (Crop gets added to Undo Stack)
- User Undos the Crop (Crop is popped off that stack and is available for Redo)
- User makes a Crop Selection
- User makes a Redo Action (Because the crop selection is active, prior
to the change we would apply the crop stroke which would purge the Redo
Stack, deleting the
KisSavedMacroCommand*
which later would be used inKisSavedCommandBase::runStroke
[its vtable]).
Since there is no stroke running during selection, we only have to clear the selection.