summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-05 19:44:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-08-06 22:17:36 +0200
commit3ea75ad97f336108fc1b1afe2d6678e96e1f4831 (patch)
tree803c101987801aeb39dedbbb85b24b76aa9fa61e /filter
parentd1fa83231c8afd2b2c14f89f869ba14ba2f3e628 (diff)
coverity#1438216 Resource leak
Change-Id: I2b105221cd90ac224bb140a005ed40c30ad92837 Reviewed-on: https://gerrit.libreoffice.org/58627 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/pdf/pdfexport.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 33bcdde3f2f0..0df62a459ef3 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -392,7 +392,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
if( xRenderable.is() )
{
- VCLXDevice* pXDevice = new VCLXDevice;
+ rtl::Reference<VCLXDevice> xDevice(new VCLXDevice);
OUString aPageRange;
Any aSelection;
vcl::PDFWriter::PDFWriterContext aContext;
@@ -786,7 +786,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
OutputDevice* pOut = pPDFWriter->GetReferenceDevice();
DBG_ASSERT( pOut, "PDFExport::Export: no reference device" );
- pXDevice->SetOutputDevice( pOut );
+ xDevice->SetOutputDevice(pOut);
if( mbAddStream )
{
@@ -816,7 +816,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
Sequence< PropertyValue > aRenderOptions( 7 );
aRenderOptions[ 0 ].Name = "RenderDevice";
- aRenderOptions[ 0 ].Value <<= Reference< awt::XDevice >( pXDevice );
+ aRenderOptions[ 0 ].Value <<= uno::Reference<awt::XDevice>(xDevice.get());
aRenderOptions[ 1 ].Name = "ExportNotesPages";
aRenderOptions[ 1 ].Value <<= false;
Any& rExportNotesValue = aRenderOptions[ 1 ].Value;