Commit 35c59116 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix Bug #1391561 (PCBNew segfaults on BOM creation). Does not happen...

Pcbnew: fix Bug #1391561 (PCBNew segfaults on BOM creation).  Does not happen on all platforms. Could be due to use of data just previoulsy deleted.
Very minor other changes.
parent 15aa24af
......@@ -163,20 +163,22 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
module = module->Next();
}
// Print list
for( iter = list.begin(); iter != list.end(); iter++ )
// Print list. Also delete temporary created objects.
for( size_t ii = list.GetCount(); ii > 0; ii-- )
{
cmp* current = *iter;
cmp* current = *list.begin(); // Because the first object will be removed
// from list, all objects will be get here
msg.Empty();
msg << current->m_Id << wxT( ";\"" );
msg << current->m_Ref << wxT( "\";\"" );
msg << FROM_UTF8( current->m_fpid.Format().c_str() ) << wxT( "\";" );
msg << FROM_UTF8( current->m_fpid.GetFootprintName().c_str() ) << wxT( "\";" );
msg << current->m_CmpCount << wxT( ";\"" );
msg << current->m_Val << wxT( "\";;;\n" );
fprintf( fp_bom, "%s", TO_UTF8( msg ) );
// We do not need this object, now: remove it from list and delete it
list.DeleteObject( current );
delete (current);
}
......
......@@ -252,14 +252,23 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, LAYER_ID aLayer,
case B_CrtYd:
case F_Fab:
case B_Fab:
PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
plotOpt.SetSkipPlotNPTH_Pads( false );
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
else
PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
break;
default:
plotOpt.SetSkipPlotNPTH_Pads( false );
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
else
PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
break;
}
}
......
......@@ -306,7 +306,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, wxEmptyString,
KiBitmap( web_support_xpm ),
_( "Fast access to the Web Based FreeROUTE advanced router" ) );
_( "Fast access to the FreeROUTE external advanced router" ) );
// Access to the scripting console
#if defined(KICAD_SCRIPTING_WXPYTHON)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment