From 0c92a8583a6435ee9e04c231dec7eb460d8cbf1c Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 22 Sep 2015 17:55:10 +0200 Subject: [PATCH] Fixed crash on tracks & vias clean up (GAL). --- pcbnew/clean.cpp | 6 ++++++ pcbnew/dialogs/dialog_global_deletion.cpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index 8931b4af41..7ce12892f8 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -120,6 +120,7 @@ void PCB_EDIT_FRAME::Clean_Pcb() if( dlg.ShowModal() != wxID_OK ) return; + // Old model has to be refreshed, GAL normally does not keep updating it if( IsGalCanvasActive() ) Compile_Ratsnest( NULL, false ); @@ -128,6 +129,11 @@ void PCB_EDIT_FRAME::Clean_Pcb() cleaner.CleanupBoard( this, dlg.m_cleanVias, dlg.m_mergeSegments, dlg.m_deleteUnconnectedSegm ); + + // There is a chance that some of tracks have changed their nets, so rebuild ratsnest from scratch + if( IsGalCanvasActive() ) + GetBoard()->GetRatsnest()->ProcessBoard(); + m_canvas->Refresh( true ); } diff --git a/pcbnew/dialogs/dialog_global_deletion.cpp b/pcbnew/dialogs/dialog_global_deletion.cpp index 51cf17d6d9..8d1c2b4c52 100644 --- a/pcbnew/dialogs/dialog_global_deletion.cpp +++ b/pcbnew/dialogs/dialog_global_deletion.cpp @@ -266,8 +266,9 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete() if( gen_rastnest ) m_Parent->Compile_Ratsnest( NULL, true ); + // There is a chance that some of tracks have changed their nets, so rebuild ratsnest from scratch if( m_Parent->IsGalCanvasActive() ) - pcb->GetRatsnest()->Recalculate(); + pcb->GetRatsnest()->ProcessBoard(); m_Parent->GetCanvas()->Refresh(); m_Parent->OnModify();