Browse Source

PNS router: fix a crash when switching to next/previous copper layer.

When (key + and - ) switching to next/previous layer before any usage of
the PNS router, Pcbnew crashed, likely due to incorrect value (perhaps
missing init) of the PNS_KICAD_IFACE (m_iface) m_board member.
So ensure this member is up to date before using it in ROUTER TOOL events.
pcb_db
jean-pierre charras 1 year ago
parent
commit
6c26497213
  1. 4
      pcbnew/router/router_tool.cpp

4
pcbnew/router/router_tool.cpp

@ -876,6 +876,10 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
if( !IsToolActive() )
return 0;
// Ensure PNS_KICAD_IFACE (m_iface) m_board member is up to date
// For some reason, this is not always the case
m_iface->SetBoard( board() );
// First see if this is one of the switch layer commands
BOARD* brd = board();
LSET enabledLayers = LSET::AllCuMask( brd->GetDesignSettings().GetCopperLayerCount() );

Loading…
Cancel
Save