Skip to content

Commit

Permalink
Pcbnew: Apply a fix made in stable branch, in AppendBoard, to avoid p…
Browse files Browse the repository at this point in the history
…otential crash.
  • Loading branch information
jp-charras committed Apr 22, 2017
1 parent 0e6723b commit 9e321a4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pcbnew/tools/pcbnew_control.cpp
Expand Up @@ -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>();
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 9e321a4

Please sign in to comment.