mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
StartPlot can fail and leave a broken file handle
Related https://gitlab.com/kicad/code/kicad/-/issues/15782
This commit is contained in:
parent
b5dacc659d
commit
a347aa7647
@ -1227,14 +1227,14 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aL
|
||||
AddGerberX2Attribute( plotter, aBoard, aLayer, not useX2mode );
|
||||
}
|
||||
|
||||
plotter->StartPlot( wxT( "1" ) );
|
||||
|
||||
if( plotter->StartPlot( wxT( "1" ) ) )
|
||||
{
|
||||
// Plot the frame reference if requested
|
||||
if( aPlotOpts->GetPlotFrameRef() )
|
||||
{
|
||||
PlotDrawingSheet( plotter, aBoard->GetProject(), aBoard->GetTitleBlock(),
|
||||
aBoard->GetPageSettings(), &aBoard->GetProperties(), wxT( "1" ), 1,
|
||||
aSheetName, aSheetPath, aBoard->GetFileName(),
|
||||
aBoard->GetPageSettings(), &aBoard->GetProperties(), wxT( "1" ),
|
||||
1, aSheetName, aSheetPath, aBoard->GetFileName(),
|
||||
renderSettings->GetLayerColor( LAYER_DRAWINGSHEET ) );
|
||||
|
||||
if( aPlotOpts->GetMirror() )
|
||||
@ -1252,6 +1252,7 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aL
|
||||
|
||||
return plotter;
|
||||
}
|
||||
}
|
||||
|
||||
delete plotter->RenderSettings();
|
||||
delete plotter;
|
||||
|
Loading…
x
Reference in New Issue
Block a user