diff options
author | tsepez <tsepez@chromium.org> | 2016-09-19 12:08:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-19 12:08:38 -0700 |
commit | c6c2e36f59f54b17d9e2c54a2003166e79ccb5e6 (patch) | |
tree | e75e6600e3610a92d8f200c994b92e9d409faf88 | |
parent | 52d6868075ff23d5081d4c0185c7619f4c084553 (diff) | |
download | pdfium-chromium/2866.tar.xz |
Remove CPDF_Object::Destroy { delete this; }chromium/2866
We can delete this just fine on our own.
Review-Url: https://codereview.chromium.org/2355593002
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp | 10 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_object.cpp | 2 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_object.h | 1 |
3 files changed, 6 insertions, 7 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp b/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp index 711b3da614..dc639feb1a 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp @@ -13,7 +13,7 @@ CPDF_IndirectObjectHolder::CPDF_IndirectObjectHolder() : m_LastObjNum(0) {} CPDF_IndirectObjectHolder::~CPDF_IndirectObjectHolder() { for (const auto& pair : m_IndirectObjs) - pair.second->Destroy(); + delete pair.second; } CPDF_Object* CPDF_IndirectObjectHolder::GetIndirectObject( @@ -38,7 +38,7 @@ CPDF_Object* CPDF_IndirectObjectHolder::GetOrParseIndirectObject( pObj->m_ObjNum = objnum; m_LastObjNum = std::max(m_LastObjNum, objnum); if (m_IndirectObjs[objnum]) - m_IndirectObjs[objnum]->Destroy(); + delete m_IndirectObjs[objnum]; m_IndirectObjs[objnum] = pObj; return pObj; @@ -67,10 +67,10 @@ bool CPDF_IndirectObjectHolder::ReplaceIndirectObjectIfHigherGeneration( CPDF_Object* pOldObj = GetIndirectObject(objnum); if (pOldObj) { if (pObj->GetGenNum() <= pOldObj->GetGenNum()) { - pObj->Destroy(); + delete pObj; return false; } - pOldObj->Destroy(); + delete pOldObj; } pObj->m_ObjNum = objnum; m_IndirectObjs[objnum] = pObj; @@ -83,6 +83,6 @@ void CPDF_IndirectObjectHolder::ReleaseIndirectObject(uint32_t objnum) { if (!pObj || pObj->GetObjNum() == CPDF_Object::kInvalidObjNum) return; - pObj->Destroy(); + delete pObj; m_IndirectObjs.erase(objnum); } diff --git a/core/fpdfapi/fpdf_parser/cpdf_object.cpp b/core/fpdfapi/fpdf_parser/cpdf_object.cpp index 7da12a2b4f..442aaeda76 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_object.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_object.cpp @@ -41,7 +41,7 @@ void CPDF_Object::Release() { if (m_ObjNum) return; - Destroy(); + delete this; } CFX_ByteString CPDF_Object::GetString() const { diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_object.h b/core/fpdfapi/fpdf_parser/include/cpdf_object.h index 8d9bb01119..115ce02200 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_object.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_object.h @@ -95,7 +95,6 @@ class CPDF_Object { CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} virtual ~CPDF_Object(); - void Destroy() { delete this; } CPDF_Object* CloneObjectNonCyclic(bool bDirect) const; |