Fix schematic editor crash when dragging symbols.
Do not set view items or update connectivity until after commit changes are updated in the SCH_SREEN. Updating the screen can force LIB_SYMBOL changes which and lead to stale LIB_PIN object pointers stored in SCH_PIN objects. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16846
This commit is contained in:
parent
63fc89cafd
commit
3d690da305
|
@ -509,7 +509,6 @@ void SCH_COMMIT::Revert()
|
|||
view->Remove( item );
|
||||
|
||||
item->SwapData( copy );
|
||||
item->SetConnectivityDirty();
|
||||
|
||||
// Special cases for items which have instance data
|
||||
if( item->GetParent() && item->GetParent()->Type() == SCH_SYMBOL_T
|
||||
|
@ -525,11 +524,14 @@ void SCH_COMMIT::Revert()
|
|||
}
|
||||
}
|
||||
|
||||
// This must be called before any calls that require stable object pointers.
|
||||
screen->Update( item );
|
||||
|
||||
item->SetConnectivityDirty();
|
||||
|
||||
if( view )
|
||||
view->Add( item );
|
||||
|
||||
screen->Update( item );
|
||||
|
||||
delete copy;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue