Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp

Issue 2355593002: Remove CPDF_Object::Destroy { delete this; } (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_parser/cpdf_object.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp b/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp
index 711b3da6144c38af79bc5426007edd28cc725afc..dc639feb1a4b28915b5916d23e4fb68523e82c50 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);
}
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_parser/cpdf_object.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698