Fixed crash on tracks & vias clean up (GAL).

This commit is contained in:
Maciej Suminski 2015-09-22 17:55:10 +02:00
parent e97395090c
commit 0c92a8583a
2 changed files with 8 additions and 1 deletions

View File

@ -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 );
}

View File

@ -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();