summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-06-01 01:20:00 +0200
committerMichael Stahl <mstahl@redhat.com>2016-06-01 09:58:17 +0000
commit619a41940f0a3be91c8419a571943217183ced18 (patch)
tree79bae8dc9f63fb98d4a6fbed001e64f733253c5b
parente0f9d3c5bc448868732e8e21568a596340512ce3 (diff)
tdf#89329: use unique_ptr for pImpl in accessiblecontexthelper
Change-Id: Ib78ee2f1faa4f9430e08bfbd0cfb0863da7d6dcb Reviewed-on: https://gerrit.libreoffice.org/25744 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--comphelper/source/misc/accessiblecontexthelper.cxx6
-rw-r--r--include/comphelper/accessiblecontexthelper.hxx3
2 files changed, 3 insertions, 6 deletions
diff --git a/comphelper/source/misc/accessiblecontexthelper.cxx b/comphelper/source/misc/accessiblecontexthelper.cxx
index 7ff1bcb5d564..02b7b9e951db 100644
--- a/comphelper/source/misc/accessiblecontexthelper.cxx
+++ b/comphelper/source/misc/accessiblecontexthelper.cxx
@@ -74,10 +74,9 @@ namespace comphelper
OAccessibleContextHelper::OAccessibleContextHelper( IMutex* _pExternalLock )
:OAccessibleContextHelper_Base( GetMutex() )
- ,m_pImpl( nullptr )
+ ,m_pImpl(new OContextHelper_Impl)
{
assert(_pExternalLock);
- m_pImpl = new OContextHelper_Impl();
m_pImpl->setExternalLock( _pExternalLock );
}
@@ -95,9 +94,6 @@ namespace comphelper
// is not used anymore
ensureDisposed();
-
- delete m_pImpl;
- m_pImpl = nullptr;
}
diff --git a/include/comphelper/accessiblecontexthelper.hxx b/include/comphelper/accessiblecontexthelper.hxx
index ed029a053880..3308c09cc984 100644
--- a/include/comphelper/accessiblecontexthelper.hxx
+++ b/include/comphelper/accessiblecontexthelper.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <comphelper/broadcasthelper.hxx>
#include <comphelper/comphelperdllapi.h>
+#include <memory>
namespace comphelper
@@ -86,7 +87,7 @@ namespace comphelper
,public OAccessibleContextHelper_Base
{
private:
- OContextHelper_Impl* m_pImpl;
+ std::unique_ptr<OContextHelper_Impl> m_pImpl;
protected:
virtual ~OAccessibleContextHelper( );