Kaydet (Commit) 7af3b9d7 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in OZipFileAccess

Change-Id: Iaad8b364b1a244bd559e582a1622dd59b4756759
Reviewed-on: https://gerrit.libreoffice.org/53226Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b603dad2
......@@ -47,7 +47,7 @@ class OZipFileAccess : public ::cppu::WeakImplHelper<
css::uno::Reference< css::uno::XComponentContext > m_xContext;
css::uno::Reference< css::io::XInputStream > m_xContentStream;
std::unique_ptr<ZipFile> m_pZipFile;
::comphelper::OInterfaceContainerHelper2* m_pListenersContainer;
std::unique_ptr<::comphelper::OInterfaceContainerHelper2> m_pListenersContainer;
bool m_bDisposed;
bool m_bOwnContent;
......
......@@ -413,8 +413,7 @@ void SAL_CALL OZipFileAccess::dispose()
{
lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) );
m_pListenersContainer->disposeAndClear( aSource );
delete m_pListenersContainer;
m_pListenersContainer = nullptr;
m_pListenersContainer.reset();
}
m_pZipFile.reset();
......@@ -436,7 +435,7 @@ void SAL_CALL OZipFileAccess::addEventListener( const uno::Reference< lang::XEve
throw lang::DisposedException(THROW_WHERE );
if ( !m_pListenersContainer )
m_pListenersContainer = new ::comphelper::OInterfaceContainerHelper2( m_aMutexHolder->GetMutex() );
m_pListenersContainer.reset( new ::comphelper::OInterfaceContainerHelper2( m_aMutexHolder->GetMutex() ) );
m_pListenersContainer->addInterface( xListener );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment