Pcbnew: fix potential issue (crash) when loading board files with a missing net section (like created by Gerbview) due to an initialization made to late.

This commit is contained in:
jean-pierre charras 2016-07-05 17:01:41 +02:00
parent df99b4068d
commit 05f849a746
1 changed files with 10 additions and 8 deletions

View File

@ -570,8 +570,17 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// Rebuild the new pad list (for drc and ratsnet control ...)
GetBoard()->m_Status_Pcb = 0;
// Update info shown by the horizontal toolbars
// Update current netclass:NETCLASS::Default alwaysxists
SetCurrentNetClass( NETCLASS::Default );
// Rebuild list of nets (full ratsnest rebuild)
{
wxBusyCursor dummy; // Displays an Hourglass while building connectivity
Compile_Ratsnest( NULL, true );
GetBoard()->GetRatsnest()->ProcessBoard();
}
// Update info shown by the horizontal toolbars
ReFillLayerWidget();
ReCreateLayerBox();
@ -591,13 +600,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// Display the loaded board:
Zoom_Automatique( false );
// Compile ratsnest and displays net info
{
wxBusyCursor dummy; // Displays an Hourglass while building connectivity
Compile_Ratsnest( NULL, true );
GetBoard()->GetRatsnest()->ProcessBoard();
}
SetMsgPanel( GetBoard() );
// Refresh the 3D view, if any