diff options
author | tsepez <tsepez@chromium.org> | 2016-11-03 17:05:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-03 17:05:08 -0700 |
commit | 4de3d095c9d9e961f93750cf1ebd489fd515be12 (patch) | |
tree | 81db6141dde9336ec31be9ceadb0183433a394bf /core/fpdfapi/page/fpdf_page_parser_old.cpp | |
parent | 7f3a8c3c317b291b44521a6a0c4dd192ad2d5966 (diff) | |
download | pdfium-4de3d095c9d9e961f93750cf1ebd489fd515be12.tar.xz |
Remove CPDF_Object::Release() in favor of direct delete
Follow-on once we prove Release always deletes in previous CL.
Review-Url: https://codereview.chromium.org/2384883003
Diffstat (limited to 'core/fpdfapi/page/fpdf_page_parser_old.cpp')
-rw-r--r-- | core/fpdfapi/page/fpdf_page_parser_old.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/core/fpdfapi/page/fpdf_page_parser_old.cpp b/core/fpdfapi/page/fpdf_page_parser_old.cpp index 0d1db43825..51ffc11b03 100644 --- a/core/fpdfapi/page/fpdf_page_parser_old.cpp +++ b/core/fpdfapi/page/fpdf_page_parser_old.cpp @@ -138,9 +138,7 @@ CPDF_StreamParser::CPDF_StreamParser( m_pPool(pPool) {} CPDF_StreamParser::~CPDF_StreamParser() { - if (m_pLastObj) { - m_pLastObj->Release(); - } + delete m_pLastObj; } CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, @@ -252,10 +250,8 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, } CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement() { - if (m_pLastObj) { - m_pLastObj->Release(); - m_pLastObj = nullptr; - } + delete m_pLastObj; + m_pLastObj = nullptr; m_WordSize = 0; bool bIsNumber = true; @@ -374,7 +370,7 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray, break; if (!m_WordSize || m_WordBuffer[0] != '/') { - pDict->Release(); + delete pDict; return nullptr; } @@ -382,12 +378,12 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray, PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1)); CPDF_Object* pObj = ReadNextObject(true, 0); if (!pObj) { - pDict->Release(); + delete pDict; return nullptr; } if (key.IsEmpty()) - pObj->Release(); + delete pObj; else pDict->SetFor(key, pObj); } |