diff --git a/eeschema/sch_commit.cpp b/eeschema/sch_commit.cpp index d7d485f4cc..21c1bb0307 100644 --- a/eeschema/sch_commit.cpp +++ b/eeschema/sch_commit.cpp @@ -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; }