[Libreoffice-commits] core.git: ucb/source
Noel Grandin
noel.grandin at collabora.co.uk
Fri Jan 26 07:11:37 UTC 2018
ucb/source/sorter/sortdynres.cxx | 6 +++---
ucb/source/sorter/sortdynres.hxx | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
New commits:
commit b4155c305daf5c64b964bb2b8ea8d6bd672fd46b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Jan 22 14:24:02 2018 +0200
loplugin:useuniqueptr in SortedDynamicResultSet
Change-Id: Ife4849926f26631bbe65bd22158165fac306cd43
Reviewed-on: https://gerrit.libreoffice.org/48586
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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;
More information about the Libreoffice-commits
mailing list