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

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page.cpp

Issue 1093213002: Remove Release() from CPDF_PageObject (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Move dtor to .cpp file. Created 5 years, 8 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 | « core/include/fpdfapi/fpdf_pageobj.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_page/fpdf_page.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 998bc274b0da8ac9e8885a74f97d144f282504e8..4ec753d75188b585441b483b46e84795b6787936 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -7,10 +7,6 @@
#include "../../../include/fpdfapi/fpdf_page.h"
#include "../../../include/fpdfapi/fpdf_module.h"
#include "pageint.h"
-void CPDF_PageObject::Release()
-{
- delete this;
-}
CPDF_PageObject* CPDF_PageObject::Create(int type)
{
switch (type) {
@@ -27,6 +23,9 @@ CPDF_PageObject* CPDF_PageObject::Create(int type)
}
return NULL;
}
+CPDF_PageObject::~CPDF_PageObject()
+{
+}
CPDF_PageObject* CPDF_PageObject::Clone() const
{
CPDF_PageObject* pObj = Create(m_Type);
@@ -689,11 +688,7 @@ CPDF_PageObjects::~CPDF_PageObjects()
}
FX_POSITION pos = m_ObjectList.GetHeadPosition();
while (pos) {
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- if (!pPageObj) {
- continue;
- }
- pPageObj->Release();
+ delete (CPDF_PageObject*)m_ObjectList.GetNext(pos);
}
}
void CPDF_PageObjects::ContinueParse(IFX_Pause* pPause)
@@ -808,11 +803,7 @@ void CPDF_PageObjects::ClearCacheObjects()
if (m_bReleaseMembers) {
FX_POSITION pos = m_ObjectList.GetHeadPosition();
while (pos) {
- CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_ObjectList.GetNext(pos);
- if (!pPageObj) {
- continue;
- }
- pPageObj->Release();
+ delete (CPDF_PageObject*)m_ObjectList.GetNext(pos);
}
}
m_ObjectList.RemoveAll();
« no previous file with comments | « core/include/fpdfapi/fpdf_pageobj.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698