diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index 2bcd65f794..5785662d5e 100644 --- a/pcbnew/tools/board_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -1490,16 +1490,17 @@ int BOARD_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent ) canvas()->ForceRefresh(); DIALOG_ASSIGN_NETCLASS dlg( m_frame, netName, board()->GetNetClassAssignmentCandidates(), - [&]( const std::vector& aNetNames ) + [this]( const std::vector& aNetNames ) { - selectionTool->ClearSelection(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + selTool->ClearSelection(); for( const wxString& curr_netName : aNetNames ) { int curr_netCode = board()->GetNetInfo().GetNetItem( curr_netName )->GetNetCode(); if( curr_netCode > 0 ) - selectionTool->SelectAllItemsOnNet( curr_netCode ); + selTool->SelectAllItemsOnNet( curr_netCode ); } canvas()->ForceRefresh();