From 0c9d08249fc87465765453a94a777190b098fdcc Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 12 Aug 2020 23:53:00 +0100 Subject: [PATCH] Fix crash where dummy edge doesn't have a valid parent. --- pcbnew/drc/drc.cpp | 1 + pcbnew/drc/drc_clearance_test_functions.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/pcbnew/drc/drc.cpp b/pcbnew/drc/drc.cpp index 988144a173..e28a80e21c 100644 --- a/pcbnew/drc/drc.cpp +++ b/pcbnew/drc/drc.cpp @@ -501,6 +501,7 @@ void DRC::testPadClearances( BOARD_COMMIT& aCommit ) m_clearanceSource = _( "board edge" ); static DRAWSEGMENT dummyEdge; + dummyEdge.SetParent( m_pcb ); dummyEdge.SetLayer( Edge_Cuts ); pad->GetRuleClearance( &dummyEdge, pad->GetLayer(), &minClearance, &m_clearanceSource ); diff --git a/pcbnew/drc/drc_clearance_test_functions.cpp b/pcbnew/drc/drc_clearance_test_functions.cpp index 5581bd35c4..e55c71fce3 100644 --- a/pcbnew/drc/drc_clearance_test_functions.cpp +++ b/pcbnew/drc/drc_clearance_test_functions.cpp @@ -496,6 +496,7 @@ void DRC::doTrackDrc( BOARD_COMMIT& aCommit, TRACK* aRefSeg, TRACKS::iterator aS m_clearanceSource = _( "board edge" ); static DRAWSEGMENT dummyEdge; + dummyEdge.SetParent( m_pcb ); dummyEdge.SetLayer( Edge_Cuts ); aRefSeg->GetRuleClearance( &dummyEdge, aRefSeg->GetLayer(), &minClearance,