Fix crash on custom shape pad primitive duplication
Fixes: lp:1750463 * https://bugs.launchpad.net/kicad/+bug/1750463
This commit is contained in:
parent
be871c0f8c
commit
ee6ac1af1d
|
@ -2036,8 +2036,12 @@ void DIALOG_PAD_PROPERTIES::onDuplicatePrimitive( wxCommandEvent& event )
|
||||||
if( dlg.ShowModal() != wxID_OK )
|
if( dlg.ShowModal() != wxID_OK )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Transfert new settings:
|
// Transfer new settings
|
||||||
dlg.Transform( &m_primitives, dlg.GetDuplicateCount() );
|
// save duplicates to a separate vector to avoid m_primitives reallocation,
|
||||||
|
// as shapeList contains pointers to its elements
|
||||||
|
std::vector<PAD_CS_PRIMITIVE> duplicates;
|
||||||
|
dlg.Transform( &duplicates, dlg.GetDuplicateCount() );
|
||||||
|
std::move( duplicates.begin(), duplicates.end(), std::back_inserter( m_primitives ) );
|
||||||
|
|
||||||
displayPrimitivesList();
|
displayPrimitivesList();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue