diff --git a/common/eda_text.cpp b/common/eda_text.cpp index e230f4be60..e54a2838e1 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -619,7 +619,7 @@ void EDA_TEXT::TransformTextShapeToSegmentList( std::vector& aCornerBuf std::shared_ptr EDA_TEXT::GetEffectiveTextShape( ) const { - std::shared_ptr shape ( new SHAPE_COMPOUND ); + std::shared_ptr shape = std::make_shared(); int penWidth = GetEffectiveTextPenWidth(); std::vector pts; TransformTextShapeToSegmentList( pts ); diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp index 8f43747963..8da80269ae 100644 --- a/pcbnew/class_dimension.cpp +++ b/pcbnew/class_dimension.cpp @@ -375,7 +375,9 @@ std::vector DIMENSION::MakeEffectiveShapes() const { std::vector effectiveShapes; - for( SHAPE* shape : Text().GetEffectiveTextShape()->Shapes() ) + std::shared_ptr ets = Text().GetEffectiveTextShape(); + + for( const SHAPE* shape : ets->Shapes() ) effectiveShapes.emplace_back( shape->Clone() ); for( const std::shared_ptr& shape : GetShapes() )