diff --git a/common/cli/command_export_pcb_dxf.cpp b/common/cli/command_export_pcb_dxf.cpp index 990199fe47..7a02e77677 100644 --- a/common/cli/command_export_pcb_dxf.cpp +++ b/common/cli/command_export_pcb_dxf.cpp @@ -64,7 +64,7 @@ CLI::EXPORT_PCB_DXF_COMMAND::EXPORT_PCB_DXF_COMMAND() : EXPORT_PCB_BASE_COMMAND( int CLI::EXPORT_PCB_DXF_COMMAND::Perform( KIWAY& aKiway ) const { - JOB_EXPORT_PCB_DXF* dxfJob = new JOB_EXPORT_PCB_DXF( true ); + std::unique_ptr dxfJob( new JOB_EXPORT_PCB_DXF( true ) ); dxfJob->m_filename = FROM_UTF8( m_argParser.get( ARG_INPUT ).c_str() ); dxfJob->m_outputFile = FROM_UTF8( m_argParser.get( ARG_OUTPUT ).c_str() ); @@ -101,7 +101,7 @@ int CLI::EXPORT_PCB_DXF_COMMAND::Perform( KIWAY& aKiway ) const dxfJob->m_printMaskLayer = layerMask; - int exitCode = aKiway.ProcessJob( KIWAY::FACE_PCB, dxfJob ); + int exitCode = aKiway.ProcessJob( KIWAY::FACE_PCB, dxfJob.get() ); return exitCode; -} \ No newline at end of file +} diff --git a/common/cli/command_export_pcb_svg.cpp b/common/cli/command_export_pcb_svg.cpp index 8cfae9ef01..7e874032c6 100644 --- a/common/cli/command_export_pcb_svg.cpp +++ b/common/cli/command_export_pcb_svg.cpp @@ -65,7 +65,7 @@ CLI::EXPORT_PCB_SVG_COMMAND::EXPORT_PCB_SVG_COMMAND() : EXPORT_PCB_BASE_COMMAND( int CLI::EXPORT_PCB_SVG_COMMAND::Perform( KIWAY& aKiway ) const { - JOB_EXPORT_PCB_SVG* svgJob = new JOB_EXPORT_PCB_SVG( true ); + std::unique_ptr svgJob( new JOB_EXPORT_PCB_SVG( true ) ); svgJob->m_mirror = m_argParser.get( ARG_MIRROR ); svgJob->m_blackAndWhite = m_argParser.get( ARG_BLACKANDWHITE ); @@ -78,7 +78,6 @@ int CLI::EXPORT_PCB_SVG_COMMAND::Perform( KIWAY& aKiway ) const if( !wxFile::Exists( svgJob->m_filename ) ) { wxFprintf( stderr, _( "Board file does not exist or is not accessible\n" ) ); - delete svgJob; return EXIT_CODES::ERR_INVALID_INPUT_FILE; } @@ -88,9 +87,7 @@ int CLI::EXPORT_PCB_SVG_COMMAND::Perform( KIWAY& aKiway ) const svgJob->m_printMaskLayer = layerMask; - int exitCode = aKiway.ProcessJob( KIWAY::FACE_PCB, svgJob ); - - delete svgJob; + int exitCode = aKiway.ProcessJob( KIWAY::FACE_PCB, svgJob.get() ); return exitCode; } diff --git a/common/jobs/job_export_pcb_dxf.h b/common/jobs/job_export_pcb_dxf.h index 435e339921..afc4d2aa3d 100644 --- a/common/jobs/job_export_pcb_dxf.h +++ b/common/jobs/job_export_pcb_dxf.h @@ -35,6 +35,7 @@ public: m_plotFootprintValues( true ), m_plotRefDes( true ), m_plotGraphicItemsUsingContours( true ), + m_pageSizeMode( 0 ), m_printMaskLayer() { } @@ -58,4 +59,4 @@ public: LSET m_printMaskLayer; }; -#endif \ No newline at end of file +#endif