From 4417f37dd88b9a899f070f030794594b97fe2da5 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 22 Jan 2018 14:22:06 +0200 Subject: loplugin:useuniqueptr in OInputCompStream Change-Id: I49fb71aa4319f6ac245885535e8afe855113e162 Reviewed-on: https://gerrit.libreoffice.org/48557 Tested-by: Jenkins Reviewed-by: Noel Grandin --- package/source/xstor/ocompinstream.cxx | 4 +--- package/source/xstor/ocompinstream.hxx | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'package/source/xstor') 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 #include #include +#include struct OWriteStream_Impl; @@ -44,7 +45,7 @@ protected: OWriteStream_Impl* m_pImpl; rtl::Reference 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; -- cgit