diff options
author | tsepez <tsepez@chromium.org> | 2016-11-04 11:38:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-04 11:38:40 -0700 |
commit | 33fdebc3da676bff84d0fd0f69b9087c0c12dfeb (patch) | |
tree | 274499f6bc4df60ebb57a52bf78b82180ea52295 /core/fpdfapi/parser/cpdf_syntax_parser.cpp | |
parent | 761eed284e1248f851fbb23beaa45835b644ecee (diff) | |
download | pdfium-33fdebc3da676bff84d0fd0f69b9087c0c12dfeb.tar.xz |
Reland "Remove CPDF_Object::Release() in favor of direct delete"
This reverts commit f0d5b6c35fa343108a3ab7a25bc2cc2b3cf105b3.
Review-Url: https://codereview.chromium.org/2478303002
Diffstat (limited to 'core/fpdfapi/parser/cpdf_syntax_parser.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_syntax_parser.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index 178af3bb9b..da3c8b0c79 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp @@ -425,8 +425,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjectHolder* pObjList, int32_t nKeys = 0; FX_FILESIZE dwSignValuePos = 0; - std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict( - new CPDF_Dictionary(m_pPool)); + std::unique_ptr<CPDF_Dictionary> pDict(new CPDF_Dictionary(m_pPool)); while (1) { CFX_ByteString key = GetNextWord(nullptr); if (key.IsEmpty()) @@ -530,8 +529,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectForStrict( } if (word == "[") { - std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Array>> pArray( - new CPDF_Array); + std::unique_ptr<CPDF_Array> pArray(new CPDF_Array); while (CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, true)) pArray->Add(pObj); @@ -544,8 +542,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectForStrict( } if (word == "<<") { - std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict( - new CPDF_Dictionary(m_pPool)); + std::unique_ptr<CPDF_Dictionary> pDict(new CPDF_Dictionary(m_pPool)); while (1) { FX_FILESIZE SavedPos = m_Pos; CFX_ByteString key = GetNextWord(nullptr); @@ -564,7 +561,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectForStrict( continue; key = PDF_NameDecode(key); - std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> obj( + std::unique_ptr<CPDF_Object> obj( GetObject(pObjList, objnum, gennum, true)); if (!obj) { uint8_t ch; @@ -692,7 +689,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, // Can't find "endstream" or "endobj". if (endStreamOffset < 0 && endObjOffset < 0) { - pDict->Release(); + delete pDict; return nullptr; } @@ -718,7 +715,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, } if (len < 0) { - pDict->Release(); + delete pDict; return nullptr; } pDict->SetIntegerFor("Length", len); @@ -727,7 +724,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict, } if (len < 0) { - pDict->Release(); + delete pDict; return nullptr; } |