From cddf8253692d3beaa97a502c8b60c1d18f81664a Mon Sep 17 00:00:00 2001 From: weili Date: Thu, 4 Aug 2016 15:43:59 -0700 Subject: Use smart pointers for class owned pointers under xfa/fde Use smart pointer to replace raw pointer type for class owned member variables so that memory management will be easier. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2208423002 --- xfa/fde/cfde_txtedtbuf.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'xfa/fde/cfde_txtedtbuf.cpp') diff --git a/xfa/fde/cfde_txtedtbuf.cpp b/xfa/fde/cfde_txtedtbuf.cpp index 7af5a1892b..58f1822661 100644 --- a/xfa/fde/cfde_txtedtbuf.cpp +++ b/xfa/fde/cfde_txtedtbuf.cpp @@ -16,17 +16,12 @@ const int kDefaultChunkCount = 2; } // namespace CFDE_TxtEdtBuf::CFDE_TxtEdtBuf() - : m_nChunkSize(kDefaultChunkSize), - m_nTotal(0), - m_bChanged(FALSE), - m_pAllocator(nullptr) { - ASSERT(m_nChunkSize); + : m_nChunkSize(kDefaultChunkSize), m_nTotal(0), m_bChanged(FALSE) { ResetChunkBuffer(kDefaultChunkCount, m_nChunkSize); } CFDE_TxtEdtBuf::~CFDE_TxtEdtBuf() { Clear(TRUE); - delete m_pAllocator; m_Chunks.RemoveAll(); } @@ -271,8 +266,6 @@ void CFDE_TxtEdtBuf::ResetChunkBuffer(int32_t nDefChunkCount, int32_t nChunkSize) { ASSERT(nChunkSize); ASSERT(nDefChunkCount); - delete m_pAllocator; - m_pAllocator = nullptr; m_Chunks.RemoveAll(); m_nChunkSize = nChunkSize; int32_t nChunkLength = -- cgit v1.2.3