From 901c3304785e260dd5b3514ca6e7326bd289935a Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 2 Mar 2022 09:20:26 -0800 Subject: [PATCH] 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 --- pcbnew/router/router_tool.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 68fc756569..808ef13be6 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -2063,6 +2063,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();