router: fixed possible use-after-free condition during segment dragging

ratsnest: fixed occasionally disappearing airwires
This commit is contained in:
Tomasz Włostowski 2017-08-29 18:47:55 +02:00
parent 82ce90ecdc
commit 20b9ed4897
2 changed files with 6 additions and 2 deletions

View File

@ -39,7 +39,7 @@
BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) : BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) :
BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED_ITEM ) BOARD_ITEM( aParent, idtype ), m_netinfo( &NETINFO_LIST::ORPHANED_ITEM )
{ {
m_localRatsnestVisible = false; m_localRatsnestVisible = true;
} }

View File

@ -890,10 +890,12 @@ int ROUTER_TOOL::mainLoop( PNS::ROUTER_MODE aMode )
} }
else if( evt->IsAction( &PCB_ACTIONS::dragFreeAngle ) ) else if( evt->IsAction( &PCB_ACTIONS::dragFreeAngle ) )
{ {
updateStartItem( *evt );
performDragging( PNS::DM_ANY | PNS::DM_FREE_ANGLE ); performDragging( PNS::DM_ANY | PNS::DM_FREE_ANGLE );
} }
else if( evt->IsAction( &PCB_ACTIONS::drag45Degree ) ) else if( evt->IsAction( &PCB_ACTIONS::drag45Degree ) )
{ {
updateStartItem( *evt );
performDragging( PNS::DM_ANY ); performDragging( PNS::DM_ANY );
} }
else if( evt->IsAction( &PCB_ACTIONS::breakTrack ) ) else if( evt->IsAction( &PCB_ACTIONS::breakTrack ) )
@ -916,10 +918,12 @@ int ROUTER_TOOL::mainLoop( PNS::ROUTER_MODE aMode )
} }
else if( evt->IsAction( &PCB_ACTIONS::remove ) ) else if( evt->IsAction( &PCB_ACTIONS::remove ) )
{ {
updateStartItem( *evt );
deleteTraces( m_startItem, false ); deleteTraces( m_startItem, false );
} }
else if( evt->IsAction( &PCB_ACTIONS::removeAlt ) ) else if( evt->IsAction( &PCB_ACTIONS::removeAlt ) )
{ {
updateStartItem( *evt );
deleteTraces( m_startItem, true ); deleteTraces( m_startItem, true );
} }
} }
@ -981,7 +985,7 @@ void ROUTER_TOOL::performDragging( int aMode )
if( m_router->RoutingInProgress() ) if( m_router->RoutingInProgress() )
m_router->StopRouting(); m_router->StopRouting();
m_startItem = NULL; m_startItem = nullptr;
frame()->UndoRedoBlock( false ); frame()->UndoRedoBlock( false );
ctls->SetAutoPan( false ); ctls->SetAutoPan( false );