diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 728e2b4acc..f1239b7fe6 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -190,8 +190,12 @@ SCH_SYMBOL::SCH_SYMBOL( const SCH_SYMBOL& aSymbol ) : m_pins.clear(); + // Copy (and re-parent) the pins for( const std::unique_ptr& pin : aSymbol.m_pins ) - m_pins.emplace_back( std::make_unique( this, pin->GetNumber(), pin->GetAlt() ) ); + { + m_pins.emplace_back( std::make_unique( *pin ) ); + m_pins.back()->SetParent( this ); + } m_fieldsAutoplaced = aSymbol.m_fieldsAutoplaced; m_schLibSymbolName = aSymbol.m_schLibSymbolName;