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

Unified Diff: core/fpdfapi/edit/fpdf_edit_create.cpp

Issue 2478253002: Revert of Remove CPDF_Object::Release() in favor of direct delete (Closed)
Patch Set: Created 4 years, 1 month 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 | « core/fpdfapi/edit/cpdf_creator.h ('k') | core/fpdfapi/font/fpdf_font.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/edit/fpdf_edit_create.cpp
diff --git a/core/fpdfapi/edit/fpdf_edit_create.cpp b/core/fpdfapi/edit/fpdf_edit_create.cpp
index a578a0a1141c81f80a64634c54c098b7ae428fed..ed638d4c407de954f4887751d1160bb3f613af6e 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() {
- if (m_bCloned)
- delete m_pDict;
+ if (m_bCloned && m_pDict)
+ m_pDict->Release();
if (m_bNewData)
FX_Free(m_pData);
}
@@ -902,8 +902,8 @@
CPDF_Creator::~CPDF_Creator() {
ResetStandardSecurity();
- if (m_bEncryptCloned) {
- delete m_pEncryptDict;
+ if (m_bEncryptCloned && m_pEncryptDict) {
+ m_pEncryptDict->Release();
m_pEncryptDict = nullptr;
}
Clear();
@@ -1247,7 +1247,7 @@
return -1;
}
if (!bExistInMap) {
- m_pDocument->DeleteIndirectObject(objnum);
+ m_pDocument->ReleaseIndirectObject(objnum);
}
} else {
uint8_t* pBuffer;
@@ -1934,7 +1934,7 @@
m_pIDArray->Add(pID1->Clone());
} else {
std::vector<uint8_t> 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 @@
return;
}
std::vector<uint8_t> 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;
« no previous file with comments | « core/fpdfapi/edit/cpdf_creator.h ('k') | core/fpdfapi/font/fpdf_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698