diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 42807707fb..53b95fd9b7 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -1099,6 +1099,14 @@ void SCH_SYMBOL::SwapData( SCH_ITEM* aItem ) std::swap( m_lib_id, symbol->m_lib_id ); + m_pins.swap( symbol->m_pins ); // std::vector's swap() + + for( std::unique_ptr& pin : symbol->m_pins ) + pin->SetParent( symbol ); + + for( std::unique_ptr& pin : m_pins ) + pin->SetParent( this ); + LIB_SYMBOL* libSymbol = symbol->m_part.release(); symbol->m_part = std::move( m_part ); symbol->UpdatePins();