summaryrefslogtreecommitdiff
path: root/io/source/stm
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-05-31 15:40:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-12 08:43:48 +0200
commite4e4d5713e248f02faf7aa6199b11e152973de8e (patch)
tree836dffa89d0a966e41b1af8270db74b9590def22 /io/source/stm
parentd4eabd5da8ea3b5ac40659c22cde19b26b3c002b (diff)
clang-tidy readability-delete-null-pointer
which in turn triggered some loplugin:useuniqueptr Change-Id: I0c38561fc9b68dac44e8cf58c8aa1f582196cc64 Reviewed-on: https://gerrit.libreoffice.org/38281 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'io/source/stm')
-rw-r--r--io/source/stm/omark.cxx15
1 files changed, 3 insertions, 12 deletions
diff --git a/io/source/stm/omark.cxx b/io/source/stm/omark.cxx
index 9053ada96698..cdf1b0924183 100644
--- a/io/source/stm/omark.cxx
+++ b/io/source/stm/omark.cxx
@@ -410,7 +410,6 @@ class OMarkableInputStream :
{
public:
OMarkableInputStream( );
- virtual ~OMarkableInputStream() override;
public: // XInputStream
@@ -452,7 +451,7 @@ private:
Reference< XInputStream > m_input;
bool m_bValidStream;
- MemRingBuffer *m_pBuffer;
+ std::unique_ptr<MemRingBuffer> m_pBuffer;
map<sal_Int32,sal_Int32,less< sal_Int32 > > m_mapMarks;
sal_Int32 m_nCurrentPos;
sal_Int32 m_nCurrentMark;
@@ -465,14 +464,7 @@ OMarkableInputStream::OMarkableInputStream()
, m_nCurrentPos(0)
, m_nCurrentMark(0)
{
- m_pBuffer = new MemRingBuffer;
-}
-
-OMarkableInputStream::~OMarkableInputStream()
-{
- if( m_pBuffer ) {
- delete m_pBuffer;
- }
+ m_pBuffer.reset( new MemRingBuffer );
}
@@ -615,8 +607,7 @@ void OMarkableInputStream::closeInput()
setPredecessor( Reference< XConnectable > () );
setSuccessor( Reference< XConnectable >() );
- delete m_pBuffer;
- m_pBuffer = nullptr;
+ m_pBuffer.reset();
m_nCurrentPos = 0;
m_nCurrentMark = 0;
}