summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-22 14:24:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-26 08:11:11 +0100
commitb4155c305daf5c64b964bb2b8ea8d6bd672fd46b (patch)
tree1372780b9d4e53f7b0408f59273d2121d6d34378 /ucb
parent398bbde8231e77bd4106c09c34839f0f16f2f7ee (diff)
loplugin:useuniqueptr in SortedDynamicResultSet
Change-Id: Ife4849926f26631bbe65bd22158165fac306cd43 Reviewed-on: https://gerrit.libreoffice.org/48586 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/sorter/sortdynres.cxx6
-rw-r--r--ucb/source/sorter/sortdynres.hxx3
2 files changed, 5 insertions, 4 deletions
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index 7d8fef03c82c..114d29c5f2e6 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -73,7 +73,7 @@ SortedDynamicResultSet::~SortedDynamicResultSet()
mxOwnListener->impl_OwnerDies();
mxOwnListener.clear();
- delete mpDisposeEventListeners;
+ mpDisposeEventListeners.reset();
mxOne.clear();
mxTwo.clear();
@@ -123,8 +123,8 @@ void SAL_CALL SortedDynamicResultSet::addEventListener(
osl::Guard< osl::Mutex > aGuard( maMutex );
if ( !mpDisposeEventListeners )
- mpDisposeEventListeners =
- new OInterfaceContainerHelper2( getContainerMutex() );
+ mpDisposeEventListeners.reset(
+ new OInterfaceContainerHelper2( getContainerMutex() ) );
mpDisposeEventListeners->addInterface( Listener );
}
diff --git a/ucb/source/sorter/sortdynres.hxx b/ucb/source/sorter/sortdynres.hxx
index 9e100df1f143..d121ba52683c 100644
--- a/ucb/source/sorter/sortdynres.hxx
+++ b/ucb/source/sorter/sortdynres.hxx
@@ -28,6 +28,7 @@
#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase.hxx>
+#include <memory>
#include "sortresult.hxx"
@@ -44,7 +45,7 @@ class SortedDynamicResultSet: public cppu::WeakImplHelper <
css::lang::XServiceInfo,
css::ucb::XDynamicResultSet >
{
- comphelper::OInterfaceContainerHelper2 *mpDisposeEventListeners;
+ std::unique_ptr<comphelper::OInterfaceContainerHelper2> mpDisposeEventListeners;
css::uno::Reference < css::ucb::XDynamicResultSetListener > mxListener;