diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index 90dc407774..47a2235569 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2013 CERN - * Copyright (C) 2013-2021 KiCad Developers, see CHANGELOG.txt for contributors. + * Copyright (C) 2013-2023 KiCad Developers, see CHANGELOG.txt for contributors. * @author Tomasz Wlostowski * * This program is free software; you can redistribute it and/or @@ -552,7 +552,11 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) static ACTION_MENU* currentMenu; - wxMenuEvent& menuEvent = *dynamic_cast( &aEvent ); + wxMenuEvent* tmp = dynamic_cast( &aEvent ); + + wxCHECK( tmp, /* void */ ); + + wxMenuEvent& menuEvent = *tmp; if( type == wxEVT_MENU_OPEN ) { diff --git a/eeschema/fields_data_model.cpp b/eeschema/fields_data_model.cpp index 54369d60cc..08be9e231d 100644 --- a/eeschema/fields_data_model.cpp +++ b/eeschema/fields_data_model.cpp @@ -942,7 +942,7 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RemoveSymbol( const SCH_SYMBOL& aSymbol ) // Remove all refs that match this symbol using remove_if m_symbolsList.erase( std::remove_if( m_symbolsList.begin(), m_symbolsList.end(), - [aSymbol]( const SCH_REFERENCE& ref ) -> bool + [&aSymbol]( const SCH_REFERENCE& ref ) -> bool { return ref.GetSymbol()->m_Uuid == aSymbol.m_Uuid; } ), diff --git a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp index d66b6d56e8..46b5b7f9eb 100644 --- a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp +++ b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp @@ -172,7 +172,11 @@ wxString SCH_EAGLE_PLUGIN::getLibName() wxFileName SCH_EAGLE_PLUGIN::getLibFileName() { - wxFileName fn( m_schematic->Prj().GetProjectPath(), getLibName(), KiCadSymbolLibFileExtension ); + wxFileName fn; + + wxCHECK( m_schematic, fn ); + + fn.Assign( m_schematic->Prj().GetProjectPath(), getLibName(), KiCadSymbolLibFileExtension ); return fn; } diff --git a/pcbnew/router/pns_item.cpp b/pcbnew/router/pns_item.cpp index b621b85c08..c514e8ca3b 100644 --- a/pcbnew/router/pns_item.cpp +++ b/pcbnew/router/pns_item.cpp @@ -246,6 +246,7 @@ bool ITEM::collideSimple( const ITEM* aHead, const NODE* aNode, obs.m_clearance = clearance; obs.m_distFirst = 0; obs.m_maxFanoutWidth = 0; + obs.m_violatingConstraint = CONSTRAINT_TYPE::CT_CLEARANCE; aCtx->obstacles.insert( obs ); } else diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 82b7bf2a56..bc945ef9a6 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -468,8 +468,15 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) { BOARD_INSPECTION_TOOL* controller = m_toolMgr->GetTool(); - if( controller && m_frame->GetPcbNewSettings()->m_ESCClearsNetHighlight ) - controller->ClearHighlight( *evt ); + try + { + if( controller && m_frame->GetPcbNewSettings()->m_ESCClearsNetHighlight ) + controller->ClearHighlight( *evt ); + } + catch( const std::runtime_error& e ) + { + wxCHECK_MSG( false, 0, e.what() ); + } } } }