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

loplugin:useuniqueptr in ResultSetBase

Change-Id: If1fca43f953acaa4d16ef6094b6e0e218e5f6307
Reviewed-on: https://gerrit.libreoffice.org/48705Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 2a0c5702
......@@ -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
......
......@@ -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;
};
......
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