[Libreoffice-commits] core.git: filter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 6 20:17:58 UTC 2018


 filter/source/pdf/pdfexport.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 3ea75ad97f336108fc1b1afe2d6678e96e1f4831
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Aug 5 19:44:07 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Aug 6 22:17:36 2018 +0200

    coverity#1438216 Resource leak
    
    Change-Id: I2b105221cd90ac224bb140a005ed40c30ad92837
    Reviewed-on: https://gerrit.libreoffice.org/58627
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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;


More information about the Libreoffice-commits mailing list