Force schematic symbol pin update when reverting a commit.

Apparently somewhere in our schematic code base we are allowing pins
to be added to symbols without correct setting the parent symbol object.
This causes all kinds of issues when the pin's parent object need to be
accessed.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16846
This commit is contained in:
Wayne Stambaugh 2024-02-10 08:49:41 -05:00
parent ae9175927b
commit b409aee28a
1 changed files with 9 additions and 0 deletions

View File

@ -527,6 +527,15 @@ void SCH_COMMIT::Revert()
// This must be called before any calls that require stable object pointers.
screen->Update( item );
// This hack is to prevent incorrectly parented symbol pins from breaking the
// connectivity algorithm.
if( item->Type() == SCH_SYMBOL_T )
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
wxCHECK2( symbol, continue );
symbol->UpdatePins();
}
item->SetConnectivityDirty();
if( view )