ucb/source/ucp/ftp/ftpresultsetbase.cxx | 15 ++++++--------- ucb/source/ucp/ftp/ftpresultsetbase.hxx | 7 +++---- 2 files changed, 9 insertions(+), 13 deletions(-)
New commits: commit af3bd4b7d3dcc3eb03fb3f599d2037b0c785c98e Author: Noel Grandin <[email protected]> Date: Tue Jan 23 15:01:38 2018 +0200 loplugin:useuniqueptr in ResultSetBase Change-Id: If1fca43f953acaa4d16ef6094b6e0e218e5f6307 Reviewed-on: https://gerrit.libreoffice.org/48705 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.cxx b/ucb/source/ucp/ftp/ftpresultsetbase.cxx index 8e10e3d07e62..7cefa0215de8 100644 --- a/ucb/source/ucp/ftp/ftpresultsetbase.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetbase.cxx @@ -48,9 +48,6 @@ ResultSetBase::ResultSetBase( ResultSetBase::~ResultSetBase() { - delete m_pIsFinalListeners; - delete m_pRowCountListeners; - delete m_pDisposeEventListeners; } @@ -97,8 +94,8 @@ ResultSetBase::addEventListener( osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pDisposeEventListeners ) - m_pDisposeEventListeners = - new comphelper::OInterfaceContainerHelper2( m_aMutex ); + m_pDisposeEventListeners.reset( + new comphelper::OInterfaceContainerHelper2( m_aMutex ) ); m_pDisposeEventListeners->addInterface( Listener ); } @@ -460,8 +457,8 @@ void SAL_CALL ResultSetBase::addPropertyChangeListener( { osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pIsFinalListeners ) - m_pIsFinalListeners = - new comphelper::OInterfaceContainerHelper2( m_aMutex ); + m_pIsFinalListeners.reset( + new comphelper::OInterfaceContainerHelper2( m_aMutex ) ); m_pIsFinalListeners->addInterface( xListener ); } @@ -469,8 +466,8 @@ void SAL_CALL ResultSetBase::addPropertyChangeListener( { osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pRowCountListeners ) - m_pRowCountListeners = - new comphelper::OInterfaceContainerHelper2( m_aMutex ); + m_pRowCountListeners.reset( + new comphelper::OInterfaceContainerHelper2( m_aMutex ) ); m_pRowCountListeners->addInterface( xListener ); } else diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.hxx b/ucb/source/ucp/ftp/ftpresultsetbase.hxx index 93bcc8b6a6b6..0cf1e638a468 100644 --- a/ucb/source/ucp/ftp/ftpresultsetbase.hxx +++ b/ucb/source/ucp/ftp/ftpresultsetbase.hxx @@ -401,10 +401,9 @@ namespace ftp { m_sProperty; osl::Mutex m_aMutex; - comphelper::OInterfaceContainerHelper2* m_pDisposeEventListeners; - - comphelper::OInterfaceContainerHelper2* m_pRowCountListeners; - comphelper::OInterfaceContainerHelper2* m_pIsFinalListeners; + std::unique_ptr<comphelper::OInterfaceContainerHelper2> m_pDisposeEventListeners; + std::unique_ptr<comphelper::OInterfaceContainerHelper2> m_pRowCountListeners; + std::unique_ptr<comphelper::OInterfaceContainerHelper2> m_pIsFinalListeners; }; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
