From 3e63d5c5a6b86bba25f84ab3fb72d5f6e9bbbbff Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 29 Oct 2025 09:15:29 -0700 Subject: [PATCH] Remove redundant ExchangeItem call This was originally here to solve https://gitlab.com/kicad/code/kicad/-/issues/17851 However, since then, we have changed how pins are handled in UpdatePins(), leading to the exchanged item having dangling pointers. Fixes https://gitlab.com/kicad/code/kicad/-/issues/21995 --- eeschema/dialogs/dialog_change_symbols.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/eeschema/dialogs/dialog_change_symbols.cpp b/eeschema/dialogs/dialog_change_symbols.cpp index 0bf8fe1ef4..b4c9dfa46a 100644 --- a/eeschema/dialogs/dialog_change_symbols.cpp +++ b/eeschema/dialogs/dialog_change_symbols.cpp @@ -640,15 +640,6 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( SCH_COMMIT* aCommit, const std::mapRemove( symbol ); SCH_SYMBOL* symbol_copy = static_cast( symbol->Clone() ); aCommit->Modified( symbol, symbol_copy, screen ); - - CONNECTION_GRAPH* connectionGraph = screen->Schematic()->ConnectionGraph(); - - // When we replace the lib symbol below, we free the associated pins if the new symbol has - // fewer than the original. This will cause the connection graph to be out of date unless - // we replace references in the graph to the old symbol/pins with references to the ones - // stored in the undo stack. - if( connectionGraph ) - connectionGraph->ExchangeItem( symbol, symbol_copy ); } for( const auto& [ symbol, symbol_change_info ] : symbols )