diff --git a/common/rc_item.cpp b/common/rc_item.cpp index 19c2d1fa8d..a7f55c3aa5 100644 --- a/common/rc_item.cpp +++ b/common/rc_item.cpp @@ -601,9 +601,11 @@ void RC_TREE_MODEL::SelectMarker( const MARKER_BASE* aMarker ) if( candidate->m_RcItem->GetParent() == aMarker ) { m_view->Select( ToItem( candidate ) ); - break; + return; } } + + wxFAIL_MSG( "Unable to select marker" ); } @@ -614,9 +616,11 @@ void RC_TREE_MODEL::CenterMarker( const MARKER_BASE* aMarker ) if( candidate->m_RcItem->GetParent() == aMarker ) { m_view->EnsureVisible( ToItem( candidate ) ); - break; + return; } } + + wxFAIL_MSG( "Unable to center marker" ); } diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 4b3b916169..bd0265edfc 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -60,6 +60,7 @@ DIALOG_DRC::DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent ) : m_unconnectedTreeModel( nullptr ), m_footprintWarningsProvider( nullptr ), m_footprintWarningsTreeModel( nullptr ), + m_centerMarkerOnIdle(nullptr), m_severities( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) { SetName( DIALOG_DRC_WINDOW_NAME ); // Set a window name to be able to find it @@ -769,6 +770,7 @@ void DIALOG_DRC::SelectMarker( const PCB_MARKER* aMarker ) void DIALOG_DRC::centerMarkerIdleHandler( wxIdleEvent& aEvent ) { m_markersTreeModel->CenterMarker( m_centerMarkerOnIdle ); + m_centerMarkerOnIdle = nullptr; Unbind( wxEVT_IDLE, &DIALOG_DRC::centerMarkerIdleHandler, this ); }