Possible fix for move/esc/esc crash.

Fixes https://gitlab.com/kicad/code/kicad/issues/12553
This commit is contained in:
Jeff Young 2022-09-30 23:05:06 +01:00
parent 11e20e52e9
commit ba630971af
1 changed files with 5 additions and 5 deletions

View File

@ -997,6 +997,11 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference )
// Discard reference point when selection is "dropped" onto the board
selection.ClearReferencePoint();
// Unselect all items to clear selection flags and then re-select the originally selected
// items.
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items );
// TODO: there's an encapsulation leak here: this commit often has more than just the move
// in it; for instance it might have a paste, append board, etc. as well.
if( restore_state )
@ -1007,11 +1012,6 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference )
// Remove the dynamic ratsnest from the screen
m_toolMgr->RunAction( PCB_ACTIONS::hideLocalRatsnest, true );
// Unselect all items to clear selection flags and then re-select the originally selected
// items.
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items );
editFrame->PopTool( aEvent );
editFrame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );