summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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( );