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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 21 17:52:08 UTC 2018


 xmlhelp/source/cxxhelp/provider/databases.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit eef4268f05ca7771651d48ab661276981ef7d573
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Dec 21 11:22:12 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Dec 21 18:51:34 2018 +0100

    use unique_ptr in xmlhelp
    
    Change-Id: Ic49bb1bc6591735562b0b23d821202bab00ceba2
    Reviewed-on: https://gerrit.libreoffice.org/65533
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index e59ddae7bea5..e12ae7930853 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -808,15 +808,15 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( const OUString& jar,
 
             Sequence< Any > aArguments( 2 );
 
-            XInputStream_impl* p = new XInputStream_impl( zipFile );
+            std::unique_ptr<XInputStream_impl> p(new XInputStream_impl( zipFile ));
             if( p->CtorSuccess() )
             {
-                Reference< XInputStream > xInputStream( p );
+                Reference< XInputStream > xInputStream( p.release() );
                 aArguments[ 0 ] <<= xInputStream;
             }
             else
             {
-                delete p;
+                p.reset();
                 aArguments[ 0 ] <<= zipFile;
             }
 


More information about the Libreoffice-commits mailing list