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 11:20:38 -04:00 committed by Wayne Stambaugh
parent 81cc0b4c42
commit 2ab90d6d20
1 changed files with 10 additions and 8 deletions

View File

@ -571,8 +571,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();
@ -592,13 +601,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