diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-22 14:22:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-25 14:12:43 +0100 |
commit | 4417f37dd88b9a899f070f030794594b97fe2da5 (patch) | |
tree | 3d53e7f7251b726ddfc04e6d2325105bd39c2721 /package/source/xstor | |
parent | 0f28c8612f4269cec95688b53d182c7c0169236d (diff) |
loplugin:useuniqueptr in OInputCompStream
Change-Id: I49fb71aa4319f6ac245885535e8afe855113e162
Reviewed-on: https://gerrit.libreoffice.org/48557
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package/source/xstor')
-rw-r--r-- | package/source/xstor/ocompinstream.cxx | 4 | ||||
-rw-r--r-- | package/source/xstor/ocompinstream.hxx | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index 06076370ea92..dd564271ecd8 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.cxx @@ -71,8 +71,6 @@ OInputCompStream::~OInputCompStream() m_refCount++; dispose(); } - - delete m_pInterfaceContainer; } uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType ) @@ -248,7 +246,7 @@ void SAL_CALL OInputCompStream::addEventListener( const uno::Reference< lang::XE } if ( !m_pInterfaceContainer ) - m_pInterfaceContainer = new ::comphelper::OInterfaceContainerHelper2( m_xMutex->GetMutex() ); + m_pInterfaceContainer.reset( new ::comphelper::OInterfaceContainerHelper2( m_xMutex->GetMutex() ) ); m_pInterfaceContainer->addInterface( xListener ); } diff --git a/package/source/xstor/ocompinstream.hxx b/package/source/xstor/ocompinstream.hxx index 68c2ce2262ae..c41c2c25f40a 100644 --- a/package/source/xstor/ocompinstream.hxx +++ b/package/source/xstor/ocompinstream.hxx @@ -31,6 +31,7 @@ #include <comphelper/interfacecontainer2.hxx> #include <comphelper/refcountedmutex.hxx> #include <rtl/ref.hxx> +#include <memory> struct OWriteStream_Impl; @@ -44,7 +45,7 @@ protected: OWriteStream_Impl* m_pImpl; rtl::Reference<comphelper::RefCountedMutex> m_xMutex; css::uno::Reference < css::io::XInputStream > m_xStream; - ::comphelper::OInterfaceContainerHelper2* m_pInterfaceContainer; + std::unique_ptr<::comphelper::OInterfaceContainerHelper2> m_pInterfaceContainer; css::uno::Sequence < css::beans::PropertyValue > m_aProperties; bool m_bDisposed; sal_Int32 m_nStorageType; |