Fix crash when switching from dragging to routine (PNS router)
The attached patch fixes a bug where triggering InlineDrag while routing is in progress will crash pcbnew. The problem is that the InlineDrag event does not terminate performRouting. Once InlineDrag is finished it will call StopRouting which deletes the m_placer. The Wait() in performRouting will then return and it will crash as soon as it tries to access the m_placer.
This commit is contained in:
parent
c86773462f
commit
29eb696ef7
|
@ -601,6 +601,9 @@ void ROUTER_TOOL::performRouting()
|
|||
|
||||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// Don't crash if we missed an operation that cancelled routing.
|
||||
wxCHECK2( m_router->RoutingInProgress(), break );
|
||||
|
||||
if( evt->IsMotion() )
|
||||
{
|
||||
m_router->SetOrthoMode( evt->Modifier( MD_CTRL ) );
|
||||
|
@ -644,7 +647,8 @@ void ROUTER_TOOL::performRouting()
|
|||
break;
|
||||
}
|
||||
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt )
|
||||
|| evt->IsUndoRedo() )
|
||||
|| evt->IsUndoRedo()
|
||||
|| evt->IsAction( &PCB_ACTIONS::routerInlineDrag ) )
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue