diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-15 16:20:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-17 10:16:35 +0200 |
commit | aa881ba9ee9367c6d665ed417ccd02974e4fa5e4 (patch) | |
tree | 2c560b8a1ae797632c748966663f692c20fa85e7 /svtools | |
parent | 5ed542f8a3ce41f92e0d88d1452a6128f9a70db1 (diff) |
loplugin:useuniqueptr in ODocumentCloser
Change-Id: I7f985e4f63631909365560b8409a33180738043f
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/hatchwindow/documentcloser.cxx | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx index 9840cab38cdc..2285da9a3d63 100644 --- a/svtools/source/hatchwindow/documentcloser.cxx +++ b/svtools/source/hatchwindow/documentcloser.cxx @@ -49,13 +49,12 @@ class ODocumentCloser : public ::cppu::WeakImplHelper< css::lang::XComponent, { ::osl::Mutex m_aMutex; css::uno::Reference< css::frame::XFrame > m_xFrame; - ::comphelper::OInterfaceContainerHelper2* m_pListenersContainer; // list of listeners + std::unique_ptr<::comphelper::OInterfaceContainerHelper2> m_pListenersContainer; // list of listeners bool m_bDisposed; public: explicit ODocumentCloser(const css::uno::Sequence< css::uno::Any >& aArguments); - virtual ~ODocumentCloser() override; // XComponent virtual void SAL_CALL dispose() override; @@ -165,15 +164,6 @@ ODocumentCloser::ODocumentCloser(const css::uno::Sequence< css::uno::Any >& aArg } -ODocumentCloser::~ODocumentCloser() -{ - if ( m_pListenersContainer ) - { - delete m_pListenersContainer; - m_pListenersContainer = nullptr; - } -} - // XComponent void SAL_CALL ODocumentCloser::dispose() @@ -206,7 +196,7 @@ void SAL_CALL ODocumentCloser::addEventListener( const uno::Reference< lang::XEv throw lang::DisposedException(); // TODO if ( !m_pListenersContainer ) - m_pListenersContainer = new ::comphelper::OInterfaceContainerHelper2( m_aMutex ); + m_pListenersContainer.reset( new ::comphelper::OInterfaceContainerHelper2( m_aMutex ) ); m_pListenersContainer->addInterface( xListener ); } |