diff options
-rw-r--r-- | sw/inc/ndole.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/ole/ndole.cxx | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx index cc72ff6279a3..f77f70905a32 100644 --- a/sw/inc/ndole.hxx +++ b/sw/inc/ndole.hxx @@ -46,7 +46,7 @@ class SW_DLLPUBLIC SwOLEObj // eventually buffered data if it is a chart OLE drawinglayer::primitive2d::Primitive2DContainer m_aPrimitive2DSequence; basegfx::B2DRange m_aRange; - DeflateData* m_pDeflateData; + std::unique_ptr<DeflateData> m_pDeflateData; SwOLEObj( const SwOLEObj& rObj ) = delete; diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 755410d33bc9..6101302bf40b 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -1019,8 +1019,7 @@ drawinglayer::primitive2d::Primitive2DContainer const & SwOLEObj::tryToGetChartC // copy the result data and cleanup m_aPrimitive2DSequence = m_pDeflateData->getSequence(); m_aRange = m_pDeflateData->getRange(); - delete m_pDeflateData; - m_pDeflateData = nullptr; + m_pDeflateData.reset(); } } @@ -1048,7 +1047,7 @@ drawinglayer::primitive2d::Primitive2DContainer const & SwOLEObj::tryToGetChartC // is okay (preview will be reused) if(!m_pDeflateData) { - m_pDeflateData = new DeflateData(aXModel); + m_pDeflateData.reset( new DeflateData(aXModel) ); DeflateThread* pNew = new DeflateThread(*m_pDeflateData); comphelper::ThreadPool::getSharedOptimalPool().pushTask(pNew); } @@ -1074,8 +1073,7 @@ void SwOLEObj::resetBufferedData() { // load is in progress, wait until finished and cleanup without using it m_pDeflateData->waitFinished(); - delete m_pDeflateData; - m_pDeflateData = nullptr; + m_pDeflateData.reset(); } } |