Fix previous breakage from shared_ptr going out of scope.

Fixes https://gitlab.com/kicad/code/kicad/issues/10970
This commit is contained in:
Jeff Young 2022-03-14 23:48:50 +00:00
parent cbb6ca8500
commit 8d682002c3
1 changed files with 2 additions and 1 deletions

View File

@ -81,7 +81,8 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge( BOARD_ITEM* item, SHAPE*
DRC_CONSTRAINT_T aConstraintType,
PCB_DRC_CODE aErrorCode )
{
const SHAPE* edgeShape = edge->GetEffectiveShape( Edge_Cuts ).get();
const std::shared_ptr<SHAPE>& shape = edge->GetEffectiveShape( Edge_Cuts );
const SHAPE* edgeShape = shape.get();
if( edge->Type() == PCB_PAD_T )
edgeShape = static_cast<PAD*>( edge )->GetEffectiveHoleShape();