summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-04 11:53:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-05 11:01:03 +0200
commit2e8944702eb7b1b32392181064a04cd5ae442baf (patch)
tree9827e36be2b11295037fb413380d67b148025a28 /comphelper
parent9698654236c2772c46b914b135d60da08d7d1279 (diff)
loplugin:useuniqueptr in AccessibleEventNotifier
Change-Id: I4a77e1ea7338a2d38120597a146a5a2d893e970b Reviewed-on: https://gerrit.libreoffice.org/59996 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/accessibleeventnotifier.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/comphelper/source/misc/accessibleeventnotifier.cxx b/comphelper/source/misc/accessibleeventnotifier.cxx
index 34c82c6e74c3..e3f5a3e9d443 100644
--- a/comphelper/source/misc/accessibleeventnotifier.cxx
+++ b/comphelper/source/misc/accessibleeventnotifier.cxx
@@ -22,6 +22,7 @@
#include <comphelper/interfacecontainer2.hxx>
#include <map>
+#include <memory>
#include <limits>
using namespace ::com::sun::star::uno;
@@ -180,7 +181,7 @@ void AccessibleEventNotifier::revokeClient( const TClientId _nClient )
void AccessibleEventNotifier::revokeClientNotifyDisposing(
const TClientId _nClient, const Reference< XInterface >& _rxEventSource )
{
- ::comphelper::OInterfaceContainerHelper2* pListeners(nullptr);
+ std::unique_ptr<::comphelper::OInterfaceContainerHelper2> pListeners;
{
// rhbz#1001768 drop the mutex before calling disposeAndClear
@@ -192,7 +193,7 @@ void AccessibleEventNotifier::revokeClientNotifyDisposing(
return;
// notify the listeners
- pListeners = aClientPos->second;
+ pListeners.reset(aClientPos->second);
// we do not need the entry in the clients map anymore
// (do this before actually notifying, because some client
@@ -208,7 +209,6 @@ void AccessibleEventNotifier::revokeClientNotifyDisposing(
// now really do the notification
pListeners->disposeAndClear( aDisposalEvent );
- delete pListeners;
}
sal_Int32 AccessibleEventNotifier::addEventListener(