Clean up MODULE effective shape memory handling.

This commit is contained in:
Jeff Young 2020-10-25 23:38:21 +00:00
parent 45113f983b
commit d1c73cb1d5
2 changed files with 5 additions and 3 deletions

View File

@ -82,7 +82,9 @@ public:
aShape->GetIndexableSubshapes( subshapes );
for( SHAPE* subshape : subshapes )
m_shapes.push_back( subshape );
m_shapes.push_back( subshape->Clone() );
delete aShape;
}
else
{

View File

@ -1680,12 +1680,12 @@ std::shared_ptr<SHAPE> MODULE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
// We'll go with (2) for now....
for( D_PAD* pad : Pads() )
shape->AddShape( pad->GetEffectiveShape( aLayer ).get() );
shape->AddShape( pad->GetEffectiveShape( aLayer )->Clone() );
for( BOARD_ITEM* item : GraphicalItems() )
{
if( item->Type() == PCB_FP_SHAPE_T )
shape->AddShape( item->GetEffectiveShape( aLayer ).get() );
shape->AddShape( item->GetEffectiveShape( aLayer )->Clone() );
}
return shape;