diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2017-01-16 11:22:34 -0500 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2017-01-16 19:42:10 +0000 |
commit | eea296d7b038a3f9f690ac9bf5c190dd80de971c (patch) | |
tree | c7dc19a216a7cf9bf57914551bab49d4dbe1a7b9 /package/source | |
parent | Enable Chart XShape tests on Windows by default (diff) | |
download | core-eea296d7b038a3f9f690ac9bf5c190dd80de971c.tar.gz core-eea296d7b038a3f9f690ac9bf5c190dd80de971c.zip |
Use unique_ptr for ZipFile here.
Change-Id: I9e3bbf23f9ee7de8ad05061496eeb7d4dc74774e
Reviewed-on: https://gerrit.libreoffice.org/33175
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'package/source')
-rw-r--r-- | package/source/zippackage/zipfileaccess.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 0b716d682486..88ac19c7dc01 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -32,6 +32,7 @@ #include <ucbhelper/content.hxx> #include <rtl/ref.hxx> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; @@ -44,7 +45,6 @@ using namespace ::com::sun::star; OZipFileAccess::OZipFileAccess( const uno::Reference< uno::XComponentContext >& rxContext ) : m_aMutexHolder( new SotMutexHolder ) , m_xContext( rxContext ) -, m_pZipFile( nullptr ) , m_pListenersContainer( nullptr ) , m_bDisposed( false ) , m_bOwnContent( false ) @@ -220,7 +220,7 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu } // TODO: in case xSeekable is implemented on separated XStream implementation a wrapper is required - m_pZipFile = new ZipFile( + m_pZipFile = o3tl::make_unique<ZipFile>( m_xContentStream, m_xContext, true ); @@ -407,11 +407,7 @@ void SAL_CALL OZipFileAccess::dispose() m_pListenersContainer = nullptr; } - if ( m_pZipFile ) - { - delete m_pZipFile; - m_pZipFile = nullptr; - } + m_pZipFile.reset(); if ( m_xContentStream.is() && m_bOwnContent ) try { |