Prevent deletion while actively routing

Fixes: lp:1766280
* https://bugs.launchpad.net/kicad/+bug/1766280
This commit is contained in:
Seth Hillbrand 2018-04-24 10:44:28 -07:00
parent 345f7d0732
commit d0ffff3b88
1 changed files with 7 additions and 0 deletions

View File

@ -846,6 +846,13 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
{
ROUTER_TOOL* routerTool = static_cast<ROUTER_TOOL*>
( m_toolMgr->FindTool( "pcbnew.InteractiveRouter" ) );
// Do not delete items while actively routing.
if( routerTool && routerTool->Router() && routerTool->Router()->RoutingInProgress() )
return 0;
// get a copy instead of reference (as we're going to clear the selectio before removing items)
auto selection = m_selectionTool->RequestSelection( SELECTION_DELETABLE | SELECTION_SANITIZE_PADS );