Pcbnew: Apply a fix made in stable branch, in AppendBoard, to avoid potential crash.

This commit is contained in:
jean-pierre charras 2017-04-22 09:23:02 +02:00
parent 0e6723bb10
commit 9e321a4722
1 changed files with 5 additions and 5 deletions

View File

@ -836,6 +836,11 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent )
return 0;
}
// rebuild nets and ratsnest before any use of nets
board->BuildListOfNets();
board->SynchronizeNetsAndNetClasses();
board->GetRatsnest()->ProcessBoard();
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
@ -900,11 +905,6 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent )
editFrame->ReFillLayerWidget();
static_cast<PCB_DRAW_PANEL_GAL*>( editFrame->GetGalCanvas() )->SyncLayersVisibility( board );
// Ratsnest
board->BuildListOfNets();
board->SynchronizeNetsAndNetClasses();
board->GetRatsnest()->ProcessBoard();
// Start dragging the appended board
if( selection.Size() ) // be sure at least one item is loaded
{