From 33fdebc3da676bff84d0fd0f69b9087c0c12dfeb Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 4 Nov 2016 11:38:40 -0700 Subject: Reland "Remove CPDF_Object::Release() in favor of direct delete" This reverts commit f0d5b6c35fa343108a3ab7a25bc2cc2b3cf105b3. Review-Url: https://codereview.chromium.org/2478303002 --- core/fpdfapi/edit/cpdf_creator.h | 2 +- core/fpdfapi/edit/fpdf_edit_create.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'core/fpdfapi/edit') diff --git a/core/fpdfapi/edit/cpdf_creator.h b/core/fpdfapi/edit/cpdf_creator.h index f462115cf7..c04db6eb37 100644 --- a/core/fpdfapi/edit/cpdf_creator.h +++ b/core/fpdfapi/edit/cpdf_creator.h @@ -94,7 +94,7 @@ class CPDF_Creator { FX_FILESIZE m_XrefStart; CFX_FileSizeListArray m_ObjectOffset; CFX_ArrayTemplate m_NewObjNumArray; - std::unique_ptr> m_pIDArray; + std::unique_ptr m_pIDArray; int32_t m_FileVersion; }; diff --git a/core/fpdfapi/edit/fpdf_edit_create.cpp b/core/fpdfapi/edit/fpdf_edit_create.cpp index ed638d4c40..a578a0a114 100644 --- a/core/fpdfapi/edit/fpdf_edit_create.cpp +++ b/core/fpdfapi/edit/fpdf_edit_create.cpp @@ -470,8 +470,8 @@ CPDF_FlateEncoder::CPDF_FlateEncoder(const uint8_t* pBuffer, } CPDF_FlateEncoder::~CPDF_FlateEncoder() { - if (m_bCloned && m_pDict) - m_pDict->Release(); + if (m_bCloned) + delete m_pDict; if (m_bNewData) FX_Free(m_pData); } @@ -902,8 +902,8 @@ CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc) CPDF_Creator::~CPDF_Creator() { ResetStandardSecurity(); - if (m_bEncryptCloned && m_pEncryptDict) { - m_pEncryptDict->Release(); + if (m_bEncryptCloned) { + delete m_pEncryptDict; m_pEncryptDict = nullptr; } Clear(); @@ -1247,7 +1247,7 @@ int32_t CPDF_Creator::WriteOldIndirectObject(uint32_t objnum) { return -1; } if (!bExistInMap) { - m_pDocument->ReleaseIndirectObject(objnum); + m_pDocument->DeleteIndirectObject(objnum); } } else { uint8_t* pBuffer; @@ -1934,7 +1934,7 @@ void CPDF_Creator::InitID(bool bDefault) { m_pIDArray->Add(pID1->Clone()); } else { std::vector buffer = - PDF_GenerateFileID((uint32_t)(uintptr_t)this, m_dwLastObjNum); + PDF_GenerateFileID((uint32_t)(uintptr_t) this, m_dwLastObjNum); CFX_ByteString bsBuffer(buffer.data(), buffer.size()); m_pIDArray->Add(new CPDF_String(bsBuffer, true)); } @@ -1949,7 +1949,7 @@ void CPDF_Creator::InitID(bool bDefault) { return; } std::vector buffer = - PDF_GenerateFileID((uint32_t)(uintptr_t)this, m_dwLastObjNum); + PDF_GenerateFileID((uint32_t)(uintptr_t) this, m_dwLastObjNum); CFX_ByteString bsBuffer(buffer.data(), buffer.size()); m_pIDArray->Add(new CPDF_String(bsBuffer, true)); return; -- cgit v1.2.3