Update end item before moving on track/via change

The move even dereferences m_enditem for logging and perhaps other
actions.  We need to ensure that the end item has not been invalidated
before taking this action

Fixes https://gitlab.com/kicad/code/kicad/issues/10732

(cherry picked from commit 901c330478)
This commit is contained in:
Seth Hillbrand 2022-03-02 09:20:26 -08:00
parent 984eb0fb40
commit 4d6c2e4868
1 changed files with 2 additions and 0 deletions

View File

@ -2065,6 +2065,8 @@ int ROUTER_TOOL::onTrackViaSizeChanged( const TOOL_EVENT& aEvent )
// Changing the track width can affect the placement, so call the
// move routine without changing the destination
// Update end item first to avoid moving to an invalid/missing item
updateEndItem( aEvent );
m_router->Move( m_endSnapPoint, m_endItem );
UpdateMessagePanel();