From 52cb41095259d1d9cf0482d909aed8f6150e4589 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 31 Oct 2020 15:13:30 -0400 Subject: [PATCH] Cannot use two layers of temporary in range-for (yet) Fixes https://gitlab.com/kicad/code/kicad/-/issues/6244 --- common/eda_text.cpp | 2 +- pcbnew/class_dimension.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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() )